2using System.Collections.Generic;
38 if (points.Count == 0)
51 List<Card> list =
new List<Card>();
59 power = power * actref.refThing.material.hardness / 10;
62 string text2 = (
EClass.
sources.
calc.map.ContainsKey(text) ? text : (
EClass.
sources.
calc.map.ContainsKey(
"Sp" + text) ? (
"Sp" + text) : (text.ToLowerInvariant() +
"_")));
63 foreach (
Point p
in points)
79 text2 =
"SpEarthquake";
87 if (CC.isChara && p.
Equals(CC.pos) && points.Count >= 2)
107 effect.sr.color = elementRef.colorSprite;
109 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
110 Color startColor = (componentInChildren.endColor = elementRef.colorSprite);
111 componentInChildren.startColor = startColor;
121 float num3 = 0.06f * (float)CC.pos.Distance(p);
123 TweenUtil.Tween(num3,
null, delegate
135 effect =
Effect.
Get(
"Element/ball_" + ((e.id == 0) ?
"Void" : ((
id ==
EffectId.GravityGun) ?
"Gravity" : e.source.alias.Remove(0, 3))));
138 effect =
Effect.
Get(
"Element/ball_Fire");
140 float startDelay = ((
id == EffectId.Meteor ||
id ==
EffectId.Comet) ? 0.1f : 0.04f) * (float)center.Distance(p);
145 float duration = 0.06f * (float)center.Distance(p);
147 TweenUtil.Tween(duration,
null, delegate
165 effect.
Play(CC.pos, 0f, p);
172 effect.
Play(p).Flip(p.
x > center.x);
231 bool isChara = CC.isChara;
235 num4 = num4 * 100 / (50 + center.Distance(p) * 75);
243 Dice dice =
Dice.
Create(text2, power, CC, (actref.refThing !=
null) ? null : actref.act);
249 Debug.Log(
id.ToString() +
"/" + text2 +
"/" + power +
"/" + actref.act?.ToString() +
"/" + dice?.
ToString() +
"/" + num4);
263 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
286 num4 = num4 * 100 / (90 + center.Distance(p) * num5);
294 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as
Chara)) || (flag && c == CC))
298 if (isChara && points.Count > 1 && c !=
null && c.
isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.
Chara))
300 int num6 = CC.Evalue(302);
301 if (!CC.IsPC && CC.IsPCFactionOrMinion)
305 if (CC.HasElement(1214))
315 CC.ModExp(302, CC.IsPC ? 10 : 50);
319 num4 =
EClass.
rnd(num4 * 100 / (100 + num6 * 10 + 1));
322 CC.ModExp(302, CC.IsPC ? 20 : 100);
329 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) &&
EClass.
pc.
HasElement(1214))) &&
EClass.
rnd(5) != 0)
336 if (lang ==
"spell_hand")
338 string[] list2 =
Lang.
GetList(
"attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty(
"Touch") :
"Touch"));
339 string @ref =
"_elehand".lang(e.source.GetAltname(2), list2[4]);
340 CC.Say(c.
IsPCParty ?
"cast_hand_ally" :
"cast_hand", CC, c, @ref, c.
IsPCParty ? list2[1] : list2[2]);
344 CC.Say(lang +
"_hit", CC, c, e.
Name.ToLower());
347 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing !=
null) ?
EClass.
_map.
FindChara(actref.refThing.c_uidRefCard) :
null));
370 num4 = num4 * Act.powerMod / 100;
375 c.
DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
383 AddCon<ConGravity>(1, power);
384 AddCon<ConBlind>(4, power);
385 AddCon<ConDim>(5, power / 2);
386 AddCon<ConSupress>(3, power / 2);
387 if (actref.refThing !=
null && actref.refThing.id ==
"gun_gravity2")
389 AddCon<ConEntangle>(4, power / 3);
390 AddCon<ConSilence>(4, power / 3);
391 AddCon<ConWeakResEle>(4, power);
392 AddCon<ConNightmare>(4, power);
399 long num7 = num4 * num / 100;
400 Debug.Log(num4 +
" v:" + num7 +
" evalue:" + e.Value +
" power:" + power +
" elepMod:" + num);
406 CC.Chara.mana.Mod((
int)num7);
420 void AddCon<T>(
int rate,
int power) where T :
Condition
434 num8 = ((actref.refThing !=
null) ? actref.refThing.material.hardness : (30 + power / 20));
437 num8 = CC.LV / 3 + 40;
441 num8 = 50 + power / 20;
445 bool flag3 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (
id == EffectId.Explosive && actref.refThing ==
null)) && !(EClass._zone is
Zone_Vernis);
481 p.
ModFire(-20, extinguish:
true);
486 foreach (
Card item2
in list)
502 bool flag2 = isNeg || flag;
523 CC.
Say(
"spell_earthquake", CC, element.
Name.ToLower());
533 DamageEle(CC,
id, power, element, list, actRef,
"spell_earthquake");
542 if (list5.Count == 0)
546 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
556 DamageEle(CC,
id, power, element, list5, actRef,
"spell_ball");
565 if (list6.Count == 0)
567 list6.Add(tp.
Copy());
569 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
579 DamageEle(CC,
id, power, element, list6, actRef,
"spell_ball", tp);
587 List<Point> list7 =
new List<Point>();
588 list7.Add(tp.
Copy());
594 if (!
DamageEle(CC,
id, power, element, list7, actRef, (
id ==
EffectId.DrainBlood ||
id ==
EffectId.DrainMana) ?
"" : ((
id ==
EffectId.Sword) ?
"spell_sword" :
"spell_hand")))
596 CC.
Say(
"spell_hand_miss", CC, element.
Name.ToLower());
608 List<Point> list4 =
new List<Point>();
609 list4.Add(tp.
Copy());
610 CC.
Say((
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow", CC, element.
Name.ToLower());
616 DamageEle(CC,
id, power, element, list4, actRef, (
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow");
621 string n = actRef.n1;
622 if (!(n ==
"special"))
630 if (!
item.pos.IsSunLit)
632 item.pos.PlayEffect(
"darkwomb3");
642 CC.
Say(
"summon_ally", CC);
652 CC.
Say(
"summon_ally_fail", CC);
655 string id3 = actRef.n1;
660 bool flag5 = actRef.n1 ==
"special";
667 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ?
EClass.
rnd(2) : 0);
674 case "special_force":
685 num3 = Mathf.Clamp(7 + CC.
LV / 100, 4, 20);
694 for (
int j = 0; j < num3; j++)
702 if (point ==
null || !point.
IsValid)
710 CardBlueprint.current.lv = num5;
714 CardBlueprint.current.idEle = text;
781 if (!(n ==
"shadow"))
792 num7 = (CC.IsPCFactionOrMinion ? (CC.LV / 2) : (CC.
LV / 3 * 2));
796 num6 = chara2.LV * (100 + power / 10) / 100 + power / 30;
810 num6 = power / 10 + 1;
812 if (chara2.
LV < num6)
814 chara2.
SetLv((
int)num6);
822 if (!(n ==
"shadow"))
824 if (n ==
"special_force")
831 chara2.hp = chara2.MaxHP / 2;
836 Chara chara3 = chara2;
838 chara3.hostility = hostility2;
840 else if (!(chara2.
id ==
"cocoon") && (!(actRef.n1 ==
"monster") || actRef.refThing ==
null))
852 CC.
Say(
"summon_ally_fail", CC);
861 CC.
Say(
"summon_ally_fail", CC);
864 CC.
Say(
"spell_funnel", CC, element.
Name.ToLower());
869 chara.
SetLv(Mathf.Abs(power) / 15);
879 if (list8.Count == 0)
883 CC.
Say(
"spell_breathe", CC, element.
Name.ToLower());
893 DamageEle(CC,
id, power, element, list8, actRef,
"spell_breathe");
920 float radius = ((
id ==
EffectId.GravityGun) ? 4f : ((
id ==
EffectId.Rocket) ? 2.8f : ((
id ==
EffectId.Suicide) ? 3.5f : ((
id ==
EffectId.Flare) ? 2.1f : ((float)((
id ==
EffectId.BallBubble) ? 2 : 5))))));
921 if ((
id ==
EffectId.Explosive ||
id ==
EffectId.Rocket) && actRef.refThing !=
null)
923 radius = 2 + actRef.refThing.Evalue(666);
940 bool flag3 =
id == EffectId.Explosive ||
id == EffectId.Suicide ||
id ==
EffectId.Rocket;
942 if (list2.Count == 0)
946 cc.
Say((
id ==
EffectId.Suicide) ?
"abSuicide" :
"spell_ball", cc, element.
Name.ToLower());
952 tp.PlayEffect(
"flare");
956 cc.PlaySound((id == EffectId.Flare) ?
"spell_flare" :
"spell_ball");
963 DamageEle(actRef.origin ?? cc,
id, power, element, list2, actRef, (
id ==
EffectId.Suicide) ?
"suicide" :
"spell_ball");
973 if (list3.Count == 0)
977 CC.
Say(
"spell_bolt", CC, element.
Name.ToLower());
987 DamageEle(CC,
id, power, element, list3, actRef,
"spell_bolt");
997 CC.
Say(
"ab" +
id, CC);
1001 int id2 = ((
id ==
EffectId.Puddle) ? 4 : ((
id ==
EffectId.Bubble) ? 5 : ((
id ==
EffectId.MistOfDarkness) ? 6 : 7)));
1003 if (
id ==
EffectId.Bubble && CC.
id ==
"cancer")
1008 for (
int i = 0; i < num; i++)
1022 idEffect = idEffect,
1033 List<Card> list9 = tp.
ListCards().ToList();
1035 if (list9.Contains(CC))
1038 list9.Insert(0, CC);
1041 foreach (
Card item3
in list9)
1043 if (tc ==
null || item3 == tc)
1045 Proc(
id, power, state, CC, item3, actRef);
1046 if (flag2 && item3.
isChara && item3 != CC)
1048 CC.DoHostileAction(item3);
1050 if (actRef.refThing ==
null || !(actRef.refThing.trait is
TraitRod))
1055 if ((uint)(effectId - 200) <= 4u)
1064 CC.SayNothingHappans();
1083 int orgPower = power;
1084 if (blessed || flag)
1101 CC.
Say(
"escape", CC);
1107 if (CC.
id ==
"bell_silver")
1120 CC.
Say(
"burn_mana", CC);
1128 if (list3.Count == 0)
1136 item.PlayEffect(
"vanish");
1148 thing.c_idRefCard =
"dog_mine";
1149 Zone.ignoreSpawnAnime =
true;
1153 case EffectId.LittleSisterMigration:
1156 bool flag3 =
id ==
EffectId.SilverCatMigration;
1162 List<Chara> list2 =
new List<Chara>();
1177 if (list2.Count == 0)
1183 foreach (
Chara item2
in list2)
1188 Msg.
Say(flag3 ?
"cat_migration" :
"little_migration", list2.Count.ToString() ??
"");
1192 EClass.player.stats.catDepart += list2.Count;
1195 EClass.player.stats.sistersDepart += list2.Count;
1207 CC.
Say(
"abMagicMap_curse", CC);
1213 CC.
Say(
"abMagicMap", CC);
1231 Dice dice =
Dice.
Create(
"ActManaAbsorb", power, CC, (actRef.refThing !=
null) ? null : actRef.act);
1232 TC.mana.Mod(dice.
Roll() + TC.mana.max / 5);
1233 TC.PlaySound(
"heal");
1234 TC.PlayEffect(
"heal");
1237 CC.
Say(
"absorbMana", CC);
1249 TC.PlaySound(
"curse3");
1250 TC.PlayEffect(
"curse");
1251 TC.Say(
"forgetItems",
TC);
1252 int num4 = power / 50 + 1 +
EClass.
rnd(3);
1253 List<Thing> source =
TC.things.List((
Thing t) => t.c_IDTState == 0);
1254 for (
int j = 0; j < num4; j++)
1256 source.RandomItem().c_IDTState = 5;
1265 bool armor =
id == EffectId.EnchantArmor ||
id ==
EffectId.EnchantArmorGreat;
1266 bool flag5 =
id == EffectId.EnchantWeaponGreat ||
id ==
EffectId.EnchantArmorGreat;
1276 cc.
Say(
"enc_curse", tc);
1280 int num3 = (flag5 ? 4 : 2) + (blessed ? 1 : 0);
1281 if (tc.
encLV >= num3)
1283 cc.
Say(
"enc_resist", tc);
1293 bool flag6 =
id ==
EffectId.GreaterIdentify;
1343 int num6 = (tc.isWeightChanged ? tc.c_weight : tc.
Thing.
source.weight);
1344 tc.isWeightChanged =
true;
1352 num6 = (int)(0.01f * (
float)num6 * (float)power * 0.75f + 500f);
1353 if (num6 < 0 || num6 > 10000000)
1371 cc.
Say(
"lighten_curse", tc);
1375 num6 = num6 * (100 - power / 10) / 100;
1393 cc.
Say(
"lighten", tc);
1417 cc.
Say(
"reconstruct", tc);
1418 EClass.game.cards.uidNext +=
EClass.
rnd(30);
1422 blesstedState = state
1425 thing3.genLv = num5;
1426 thing3.idSkin = tc.
idSkin;
1430 if (thing3.
id ==
"amulet_engagement" || thing3.
id ==
"ring_engagement")
1438 thing3.rarity =
Rarity.Mythical;
1443 CC.
Pick(thing3, msg:
false);
1450 case EffectId.ChangeMaterialLesser:
1452 case EffectId.ChangeMaterialGreater:
1464 string name = tc.
Name;
1467 bool num =
id ==
EffectId.ChangeMaterialGreater;
1468 bool flag2 =
id ==
EffectId.ChangeMaterialLesser;
1488 num2 = Mathf.Clamp(num2 +
EClass.
rnd(2), 0, 4);
1491 text2 = ((text2 ==
"metal") ?
"leather" :
"metal");
1494 for (
int i = 0; i < 1000; i++)
1505 if ((tc.
id ==
"log" || tc.
id ==
"branch") && tc.material.alias ==
"carbone")
1521 cc.
Say(
"materialChanged", name, row.GetName());
1544 string name2 = tc.
Name;
1547 bool flag8 = tc.rarity ==
Rarity.Legendary;
1550 rarity = (flag8 ? Rarity.Mythical :
Rarity.Legendary),
1561 foreach (
Element item4
in thing4.elements.dict.Values.ToList().Shuffle())
1571 if ((uint)(id2 - 64) > 3u)
1577 if (flag8 && num7 >= 2)
1583 tc.isCrafted =
false;
1584 tc.rarity = (flag8 ? Rarity.Mythical :
Rarity.Legendary);
1594 c2.
Say(
"reconstruct", c2);
1601 List<string> list12 =
new List<string>();
1602 for (
int num21 = 0; num21 < 10; num21++)
1604 list12.Add(AliasGen.GetRandomAlias());
1607 }, delegate(
int a,
string b)
1610 c2.
Say(
"reconstruct", c2);
1620 CC.
Say(
"reconstruct", CC);
1634 Dialog.
InputName(
"dialogVoidReturn".lang(max.ToString() ??
""), max.ToString() ??
"", delegate(
bool cancel,
string text)
1638 destLv = Mathf.Abs(text.ToInt());
1639 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1641 Debug.Log(destLv +
"/" + zone);
1647 Msg.
Say(
"returnComplete");
1648 EClass.player.uidLastTravelZone = 0;
1650 EClass.player.lastZonePos =
null;
1651 EClass.player.returnInfo =
null;
1678 Msg.
Say(
"returnNowhere");
1691 EClass.player.returnInfo =
null;
1757 Thing t2 =
ThingGen.
Create(
new string[6] {
"330",
"331",
"334",
"335",
"336",
"1142" }.RandomItem());
1763 List<Condition> list6 =
new List<Condition>();
1766 if (GetBlessingDifficulty(condition4) > 0 &&
EClass.
rnd(GetBlessingDifficulty(condition4)) == 0)
1768 list6.Add(condition4);
1771 if (list6.Count == 0)
1776 TC.pos.PlayEffect(
"holyveil");
1777 TC.pos.PlaySound(
"holyveil");
1778 TC.Say(
"unpolluted",
TC);
1811 TC.pos.PlayEffect(
"holyveil");
1812 TC.pos.PlaySound(
"holyveil");
1813 TC.pos.PlaySound(
"atk_eleSound");
1814 TC.conditions.ForeachReverse(delegate(
Condition c)
1821 TC.Say(
"abShutterHex",
TC);
1823 List<Chara> list9 =
TC.pos.ListCharasInRadius(
TC, 4, (
Chara c) => c ==
TC || c.IsHostile(CC));
1824 for (
int m = 0; m < num15; m++)
1826 TweenUtil.Delay((
float)m * 0.1f, delegate
1830 foreach (
Chara item6
in list9)
1835 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1837 componentInChildren.startColor = startColor;
1839 TweenUtil.Delay((
float)m * 0.1f, delegate
1841 effect.
Play(center, 0f, pos);
1843 int num16 =
Dice.
Create(
"SpShutterHex", power, CC, (actRef.refThing !=
null) ? null : actRef.act).Roll();
1852 if (CC.
Dist(
TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion &&
TC.isRestrained))
1861 if (point ==
null || !CC.
CanSeeLos(point))
1865 CC.
Say(
"abDraw", CC,
TC);
1873 if (CC.
id ==
"tentacle")
1882 if (nearbyCatToSniff !=
null)
1884 CC.
Sniff(nearbyCatToSniff);
1894 if (
TC.Evalue(426) > 0)
1896 TC.Say((actRef.n1 ==
"money") ?
"abStealNegateMoney" :
"abStealNegate",
TC);
1899 Thing thing5 =
null;
1900 bool flag11 = actRef.n1 ==
"food";
1901 if (actRef.n1 ==
"money")
1913 Func<Thing, bool> func = (
Thing t) =>
true;
1916 func = (
Thing t) => t.IsFood;
1918 List<Thing> list7 =
TC.things.List(delegate(
Thing t)
1924 return t.trait.CanBeDestroyed && t.things.Count == 0 && t.invY != 1 && t.trait.CanBeStolen && !t.trait.CanOnlyCarry && !t.IsUnique && !t.isEquipped && t.blessedState == BlessedState.Normal && func(t);
1925 }, onlyAccessible:
true);
1926 if (list7.Count > 0)
1928 thing5 = list7.RandomItem();
1931 thing5 = thing5.
Split(1);
1938 CC.
Say(
"abStealNothing", CC,
TC);
1943 CC.
Pick(thing5, msg:
false);
1945 if (actRef.n1 ==
"food")
1954 CC.
Say(
"abStealEscape", CC);
1955 CC.
Teleport(GetTeleportPos(tc.
pos, 30), silent:
true);
1964 if (CC !=
null && CC !=
TC)
1966 TC.Say(
"curse", CC,
TC);
1968 TC.PlaySound(
"curse3");
1969 TC.PlayEffect(
"curse");
1970 if (
EClass.
rnd(150 +
TC.LUC * 5 +
TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) ||
TC.TryNullifyCurse())
1974 List<Thing> list11 =
TC.things.List(delegate(
Thing t)
1982 if (list11.Count == 0)
1987 Thing thing7 = list11.RandomItem();
1988 TC.Say(
"curse_hit",
TC, thing7);
1996 TC.Say(
"uncurseEQ" + (blessed ?
"_bless" : (flag ?
"_curse" :
"")),
TC);
1997 TC.PlaySound(
"uncurse");
1998 TC.PlayEffect(
"uncurse");
2006 List<Thing> list =
new List<Thing>();
2007 TC.things.Foreach(delegate(
Thing t)
2012 if (t.blessedState == BlessedState.Cursed)
2014 num20 = EClass.rnd(200);
2018 num20 = EClass.rnd(1000);
2024 if (
id ==
EffectId.UncurseEQGreater)
2030 TC.Say(
"uncurseEQ_success", t);
2046 foreach (
Thing item7
in list)
2050 if (success == 0 && fail == 0)
2052 TC.SayNothingHappans();
2056 TC.Say(
"uncurseEQ_fail");
2062 string text3 = actRef.n1;
2067 if (!text4.IsEmpty())
2074 if (!actRef.aliasEle.IsEmpty())
2076 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
2079 condition2.isPerfume = TC.IsPC && actRef.
isPerfume;
2080 Condition condition3 =
TC.AddCondition(condition2);
2081 if (condition3 !=
null && condition3.
isPerfume)
2083 condition3.value = 3;
2086 if (!text4.IsEmpty())
2098 for (
int l = 0; l < 4 +
EClass.
rnd(2); l++)
2117 bool isPowerful =
TC.IsPowerful;
2118 string n = actRef.n1;
2119 if (n ==
"ConSuffocation")
2121 power = power * 2 / 3;
2123 int num12 = TC.WIL * (isPowerful ? 20 : 5);
2125 if (condition !=
null)
2127 num12 += condition.power * 5;
2133 int num14 = (TC.IsPowerful ? 40 : 90);
2142 if (condition !=
null)
2152 TC.Say(
"debuff_resist",
TC);
2161 if (!actRef.aliasEle.IsEmpty())
2165 (con as
ConMiasma)?.SetResistPenetrationLevel(
TC, CC);
2179 TC.MutateRandom(1, 100, ether:
false, state);
2186 TC.MutateRandom(-1, 100, ether:
false, state);
2206 if (blessed || flag)
2210 Dialog.
InputName(
"dialogWish",
"q", delegate(
bool cancel,
string text)
2227 tc.
Say(
"faith_curse", tc,
faith.Name);
2232 tc.
Say(
"faith_bless", tc,
faith.Name);
2234 tc.
ModExp(306, power * 10);
2237 tc.
ModExp(85, power * 10);
2246 int gender2 = gender
switch
2260 if (blessed && age3 > 1)
2262 tc.
Say(
"ageDown", tc);
2267 tc.
Say(
"ageUp", tc);
2276 int num11 = ((actRef.refThing !=
null) ? actRef.refThing.GetInt(118) : actRef.refVal);
2282 num11 = EClass.game.seed + tc.
uid;
2286 tc.
Say(
"transBlood", tc);
2288 tc.c_bloodData =
null;
2297 if (!flag && age <= 0)
2302 age = Mathf.Max(0, age * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
2303 tc.
Say(flag ?
"ageUp" :
"ageDown", tc);
2321 tc.
Say(
"eternalYouth2", tc);
2335 tc.
Say(
"eternalYouth1", tc);
2336 tc.c_lockedAge = age2 + 1;
2348 Debug.Log(power +
"/" +
id.ToString() +
"/" + actRef.n1);
2359 else if (
id ==
EffectId.DebuffStats)
2364 if (power < 0 ||
id ==
EffectId.DebuffStats)
2366 power = Mathf.Abs(power);
2380 List<KeyValuePair<int, Chara>> list4 =
EClass.
game.
cards.
globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.isDead && a.Value.faction ==
EClass.
pc.
faction && !a.Value.isSummon && a.Value.c_wasInPcParty).ToList();
2381 if (
TC.IsPCFaction ||
TC.IsPCFactionMinion)
2383 if (
TC.IsPC && list4.Count == 0)
2387 if (list4.Count > 0)
2389 list4.RandomItem().Value.Chara.GetRevived();
2393 TC.SayNothingHappans();
2402 bool flag10 =
id == EffectId.DamageBody ||
id ==
EffectId.DamageBodyGreat;
2403 bool mind =
id == EffectId.DamageMind ||
id ==
EffectId.DamageMindGreat;
2404 int num9 = ((
id == EffectId.DamageBody ||
id ==
EffectId.DamageMind) ? 1 : (4 +
EClass.
rnd(4)));
2413 TC.PlayEffect(
"debuff");
2414 TC.PlaySound(
"debuff");
2416 TC.Say(flag10 ?
"damageBody" :
"damageMind",
TC);
2417 for (
int k = 0; k < num9; k++)
2419 TC.DamageTempElements(power, flag10, mind,
id !=
EffectId.Weaken);
2432 bool flag12 =
id == EffectId.EnhanceBody ||
id ==
EffectId.EnhanceBodyGreat;
2433 bool mind2 =
id == EffectId.EnhanceMind ||
id ==
EffectId.EnhanceMindGreat;
2438 TC.Say(flag12 ?
"enhanceBody" :
"enhanceMind",
TC);
2439 TC.PlayEffect(
"buff");
2440 TC.PlaySound(
"buff");
2441 TC.EnhanceTempElements(power, flag12, mind2, onlyRenew:
true);
2447 bool flag9 =
id ==
EffectId.RestoreBody;
2453 TC.Say(flag9 ?
"restoreBody" :
"restoreMind",
TC);
2454 TC.PlaySound(
"heal");
2455 TC.PlayEffect(
"heal");
2465 TC.CureHost(
CureType.HealComplete, power, state);
2466 TC.Say(
"heal_heavy",
TC);
2471 long num10 =
Dice.
Create((actRef.act !=
null &&
EClass.
sources.
calc.map.ContainsKey(actRef.act.ID)) ? actRef.act.ID :
"SpHealLight", power, CC, (actRef.refThing !=
null) ?
null : actRef.act).
Roll();
2472 if (actRef.refThing !=
null)
2474 num10 = num10 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2478 TC.DamageHP(num10 / 2, 919, power);
2484 num10 += TC.MaxHP / 4;
2491 TC.HealHPHost(num10, (actRef.refThing ==
null) ? HealSource.Magic :
HealSource.Item);
2494 TC.Say((power >= 300) ?
"heal_heavy" :
"heal_light",
TC);
2500 TC.Say(
"heal_jure",
TC);
2514 IList<Condition> list5 =
TC.conditions.Copy();
2526 CC.
Say(
"removeHex",
TC, item8.
Name.ToLower());
2535 CC.
Say(
"removeHex_fail",
TC, item8.
Name.ToLower());
2549 TC.PlaySound(
"heal");
2550 TC.PlayEffect(
"heal");
2553 TC.Say(
"cureCorruption_curse",
TC);
2555 TC.ModCorruption(power);
2559 TC.Say(
"cureCorruption",
TC);
2560 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2571 chara.c_altName = TC.c_altName ??
TC.source.GetName(
TC);
2583 TC.Say(
"drinkRamune",
TC);
2587 TC.Say(
"drinkGood",
TC);
2593 TC.Say(
"drinkMilk",
TC);
2610 TC.Say(
"drinkWater_dirty",
TC);
2616 TC.Say(
"drinkWater_clear",
TC);
2622 TC.Say(
"drinkWater_dirty",
TC);
2630 if (
TC.HasElement(1211))
2632 TC.Say(
"drinkSaltWater_snail",
TC);
2633 int num19 = ((TC.hp > 10) ? (
TC.hp -
EClass.
rnd(10)) : 10000);
2638 TC.Say(
"drinkSaltWater",
TC);
2643 if (
TC.HasElement(1215))
2645 TC.Say(
"drunk_dwarf",
TC);
2759 TC.PlayEffect(
"buff");
2760 TC.PlaySound(
"offering");
2761 int num17 =
TC.Evalue(1423);
2765 if (flag && num17 > 1)
2769 else if (num17 < 15)
2771 num18 = ((!blessed) ? 1 : 2);
2772 if (num18 + num17 > 15)
2779 TC.SetFeat(1423, num17 + num18, msg:
true);
2780 TC.SetInt(134,
TC.GetInt(134) + num18);
2829 if (list10.Count != 0)
2831 Thing thing6 = list10.RandomItem();
2832 TC.Say(
"acid_hit",
TC);
2835 TC.Say(
"acid_nullify", thing6);
2837 else if (thing6.
encLV > -5)
2839 TC.Say(
"acid_rust",
TC, thing6);
2851 TC.DamageHP(power / 5, actRef.idEle, power);
2862 TC.Say(
"drink_acid",
TC);
2863 TC.DamageHP(power / 5, 923, power);
2866 Msg.
Say(
"nothingHappens");
2874 TC.Say(
"love_curse_self",
TC);
2878 TC.Say(
"love_curse", CC,
TC);
2879 TC.ModAffinity(CC, -power / 4, show:
false);
2881 TC.ShowEmo(
Emo.angry);
2885 LoveMiracle(
TC, CC, power,
id, state);
2891 if (
TC.HasElement(1532))
2893 TC.SetMutation(1532);
2897 TC.SetMutation(1533, 1);
2904 if (
TC.HasElement(1533))
2906 TC.SetMutation(1533);
2910 TC.SetMutation(1532, 1);
2913 TC.PlayEffect(
"aura_heaven");
2914 TC.PlaySound(
"godbless");
2917 TC.Say(
"grow_hair_fail",
TC);
2920 TC.Say(
"grow_hair",
TC);
2937 if (!CC.IsHostile(
TC))
2957 Proc(_id, orgPower, _state, cc, tc, _ref1);
2963 tc.
Say(
"eat_poison", tc);
2965 if (power > 100000000)
2969 int num = (int)Mathf.Sqrt(power * 100);
2981 tc.
Say(
"love_ground", tc);
2985 tc.
Say(
"love_chara", c, tc);
2994 tc.
Say(
"item_drop", thing);
2998 Thing c2 = tc.
MakeMilk(effect:
true, 1, addToZone:
true, state);
2999 tc.
Say(
"item_drop", c2);
3003 Thing c3 = tc.
MakeEgg(effect:
true, 1, addToZone:
true, (idEffect ==
EffectId.LovePlus) ? 3 : 20, state);
3004 tc.
Say(
"item_drop", c3);
3018 tc.
Say(
"love_ground", tc);
3022 tc.
Say(
"love_chara", c, tc);
3031 for (
int i = 0; i < 10000; i++)
3047 string netMsg =
GameLang.
Parse(
"wish".langGame(), thirdPerson:
true, name, s);
3048 List<WishItem> list =
new List<WishItem>();
3049 long wishLv = 10 + power / 4;
3053 wishLv = wishLv * 150 / 100;
3057 wishLv = wishLv * 150 / 100;
3060 Debug.Log(power +
"/" + wishValue);
3061 string _s = s.ToLower();
3069 if (
item.giftRank >= 2 &&
item.IsValidArtifact(r.
id))
3096 string text = r.
GetName().ToLower();
3097 int score =
Compare(_s, text);
3110 if (category.IsChildOf(
"weapon") || category.IsChildOf(
"armor") || category.IsChildOf(
"ranged"))
3112 CardBlueprint.SetRarity(Rarity.Legendary);
3117 bool flag2 = thing.trait is
TraitDeed || thing.rarity >=
Rarity.Artifact || thing.
source._origin ==
"artifact_summon";
3121 thing.c_charges = 0;
3124 num = EClass.rndHalf(wishValue * 3);
3127 num = EClass.rndHalf(wishValue / 500 + 4);
3130 num = EClass.rndHalf(wishValue / 500 + 4);
3133 num = EClass.rndHalf(wishValue / 2000 + 4);
3136 if (!flag2 && thing.trait.CanStack)
3138 int num2 = wishValue;
3140 for (int i = 1; i < 1000; i++)
3142 int num3 = price + i * 2 * (price + 500);
3143 if (num3 > 0 && num2 > num3)
3152 if (price > 2500 && num > 3)
3154 num = 3 + (int)Mathf.Sqrt(num - 3);
3156 if (price > 5000 && num > 2)
3158 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
3160 if (price > 10000 && num > 1)
3162 num = 1 + Mathf.Min((
int)Mathf.Sqrt(num - 1) / 3, 2);
3169 Debug.Log(_s +
"/" + num +
"/" + score);
3170 if (thing.HasTag(
CTAG.godArtifact))
3184 if (list.Count == 0)
3186 netMsg = netMsg + Lang.space +
"wishFail".langGame();
3191 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3192 foreach (WishItem item2
in list)
3194 Debug.Log(item2.score +
"/" + s +
"/" + item2.n);
static void Poison(Chara tc, Chara c, int power)
static void LoveMiracle(Chara tc, Chara c, int power, EffectId idEffect=EffectId.Love, BlessedState? state=null)
static void Proc(EffectId id, int power, BlessedState state, Card cc, Card tc=null, ActRef actRef=default(ActRef))
static void GeneMiracle(Chara tc, Chara c, DNA.Type type)
static Point GetTeleportPos(Point org, int radius=6)
static int Compare(string s, string t)
static void TryDelay(Action a)
static void Proc(EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
static bool Wish(string s, string name, int power, BlessedState state)
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
static bool DamageEle(Card CC, EffectId id, int power, Element e, List< Point > points, ActRef actref, string lang=null, Point center=null)
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
virtual int ElementPowerMod
void SetRefVal(int a, int b)
virtual ConditionType Type
static int GetColorInt(ref Color matColor, int p)
void SetAge(Chara c, int a)
static void Set(CardBlueprint _bp=null)
GlobalCharaList globalCharas
virtual string GetName(int i)
void Teleport(Point point, bool silent=false, bool force=false)
ElementContainerCard elements
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
void SetInt(string id, int value=0)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Thing GiveBirth(Thing t, bool effect)
virtual void SetBlessedState(BlessedState s)
bool IsInMutterDistance(int d=10)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
virtual bool IsAliveInCurrentZone
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
BlessedState blessedState
void ModExp(string alias, int a)
int GetInt(string id, int? defaultInt=null)
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
SourceMaterial.Row matObj
bool HasZoneStairs(bool includeLocked=true)
void UnqeuipIfTooHeavy(Thing t)
static Chara CreateFromElement(string idEle, int lv=-1, string idFilter="chara")
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
static Chara Create(string id, int lv=-1)
override bool IsAliveInCurrentZone
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
void Cuddle(Chara c, bool headpat=false)
void InstantEat(Thing t=null, bool sound=true)
Condition AddCondition(string id, int p=100, bool force=false)
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
Chara GetNearbyCatToSniff()
bool CanSeeLos(Card c, int dist=-1)
Chara TryDuplicate(DuplicateCondition con=DuplicateCondition.Default, Point dest=null, bool inheritHostility=false)
bool RequestProtection(Chara attacker, Action< Chara > action)
bool HasCondition(string alias)
void SetMainElement(string id, int v=0, bool elemental=false)
bool HasMinion(string id)
override bool IsPCFaction
override bool IsPCPartyMinion
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
void MakeAlly(bool msg=true)
void AddCooldown(int idEle, int turns=0)
Thing MakeGene(DNA.Type? type=null)
void DoHostileAction(Card _tg, bool immediate=false)
bool TryEquip(Thing t, bool useFav=false)
void SetSummon(int duration)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
bool TryFuse(float chance=1f)
void MoveZone(string alias)
UD_String_Color elementColors
void Kill(bool silent=false)
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
static Type GetType(string idMat)
void Generate(Type _type, Chara model=null)
int GetRaw(int offsetHours=0)
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
static int RollMax(int num, int sides, int bonus=0)
static int Roll(int num, int sides, int bonus=0, Card card=null)
override string ToString()
static Dice Create(Element ele, Card c)
static int curve(long _a, int start, int step, int rate=75)
static ColorProfile Colors
static void Wait(float a, Card c)
static SourceManager sources
static float rndf(float a)
static FactionBranch Branch
static int rndHalf(int a)
static GameSetting setting
static void Create(Point center, int radius, int count, Action< int, Point > onComplete)
static void CreateComet(Point center, Action< int, Point > onComplete, Color color)
static Effect Get(Effect original)
Effect SetStartDelay(float a)
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Effect SetParticleColor(Color c)
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Dictionary< int, Element > dict
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element ModBase(int ele, int v)
Element SetBase(string alias, int v, int potential=0)
Element GetOrCreateElement(Element ele)
Element GetElement(string alias)
static int[] List_MainAttributes
static int GetId(string alias)
static Element Create(int id, int v=0)
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
bool disableUsermapBenefit
UD_String_ElementRef elements
ReligionManager religions
static string Name(int g)
static bool Has(string id)
static string[] GetList(string id)
static LayerDragGrid CreateEnchant(Chara cc, bool armor, bool superior=false, BlessedState state=BlessedState.Normal, int count=1)
static LayerDragGrid CreateChangeRarity(Chara cc, Thing consume, EffectId idEffect, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateChangeMaterial(Chara cc, Thing consume, SourceMaterial.Row mat, EffectId idEffect, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateLighten(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateUncurse(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateReconstruction(Chara cc, BlessedState state=BlessedState.Normal, int power=100, int price=0, int count=1)
static LayerDragGrid CreateIdentify(Chara cc, bool superior=false, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static void SetDirty(Thing t)
Layer SetTitles(string langList, string idHeaderRow=null)
Point GetRandomSurface(int x, int z, int radius, bool walkable=true, bool allowWater=false)
Chara FindChara(string id)
List< Point > ListPointsInArc(Point center, Point to, int radius, float angle)
void Reveal(Point center, int power=100)
void MineObj(Point point, Task task=null, Chara c=null)
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
void TryShatter(Point pos, int ele, int power, Card CC=null)
void SetEffect(int x, int z, CellEffect effect=null)
List< Point > ListPointsInLine(Point center, Point to, int radius, bool returnOnBlocked=true)
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
void RevealAll(bool reveal=true)
static bool IsSameSign(int a, int b)
static int ClampToInt(long a)
static bool IsThirdPerson(Card c)
static ThirstPersonInfo thirdPerson1
static string SayNothingHappen()
static string GetName(Card c)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
static async UniTask< bool > SendChat(string name, string msg, ChatCategory cat, string idLang)
int CountKeyItem(string alias)
SourceMaterial.Row matBlock
List< Card > ListCards(bool includeMasked=false)
override string ToString()
Point Set(int _x, int _z)
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
void ModFire(int value, bool extinguish=false)
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
bool Equals(int _x, int _z)
Effect PlayEffect(string id)
Point GetRandomNeighbor()
void Animate(AnimeID id, bool animeBlock=false)
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
static void SetBaseSeed(int a=-1)
static void SetSeed(int a=-1)
Thing Reforge(string id, Point pos=null, bool first=true)
ReligionTrickery Trickery
virtual void Talk(string idTalk, Card c=null, Card agent=null)
static void ShakeCam(string id="default", float magnitude=1f)
Dictionary< string, CardRow > map
static Dictionary< string, TierList > tierMap
static Spatial Create(string id, Spatial parent, bool register, int x=-99999, int y=-99999, int icon=0)
List< Zone > ListReturnLocations()
static SpawnList Get(string id, Func< SourceChara.Row, bool > func)
static void GetAchievement(ID_Achievement id)
static Thing Create(string id, int idMat=-1, int lv=-1)
override int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
override CardRow sourceCard
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
virtual bool UseRandomAlias
static void BadEffect(Chara c)
virtual bool CanBeAttacked
static void Reserve(string idStep, Action onBeforePlay=null)
static void Play(string idStep)
bool ContainsKey(TKey key)
bool TryGetValue(TKey key, out TValue value)
virtual string GetNewZoneID(int level)
int CountMinions(Chara c)
Card AddCard(Card t, Point point)