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)
112 id2 =
"spell_missile";
116 id2 =
"spell_moonspear";
122 effect.sr.color = elementRef.colorSprite;
124 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
125 Color startColor = (componentInChildren.endColor = elementRef.colorSprite);
126 componentInChildren.startColor = startColor;
136 float num3 = 0.06f * (float)CC.pos.Distance(p);
138 TweenUtil.Tween(num3,
null, delegate
150 effect =
Effect.
Get(
"Element/ball_" + ((e.id == 0) ?
"Void" : ((
id ==
EffectId.GravityGun) ?
"Gravity" : e.source.alias.Remove(0, 3))));
153 effect =
Effect.
Get(
"Element/ball_Fire");
155 float startDelay = ((
id == EffectId.Meteor ||
id ==
EffectId.Comet) ? 0.1f : 0.04f) * (float)center.Distance(p);
160 float duration = 0.06f * (float)center.Distance(p);
162 TweenUtil.Tween(duration,
null, delegate
172 effect2.
SetParticleColor(elementRef.colorTrail, changeMaterial:
true,
"_TintColor").
Play(point);
190 effect.
Play(CC.pos, 0f, p);
196 effect.
Play(p).Flip(p.
x > center.x);
256 bool isChara = CC.isChara;
260 num4 = num4 * 100 / (50 + center.Distance(p) * 75);
268 Dice dice =
Dice.
Create(text2, power, CC, (actref.refThing !=
null) ? null : actref.act);
274 Debug.Log(
id.ToString() +
"/" + text2 +
"/" + power +
"/" + actref.act?.ToString() +
"/" + dice?.
ToString() +
"/" + num4);
288 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
311 num4 = num4 * 100 / (90 + center.Distance(p) * num5);
319 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as
Chara)) || (flag && c == CC))
323 if (isChara && points.Count > 1 && c !=
null && c.
isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.
Chara))
325 int num6 = CC.Evalue(302);
326 if (!CC.IsPC && CC.IsPCFactionOrMinion)
330 if (CC.HasElement(1214))
340 CC.ModExp(302, CC.IsPC ? 10 : 50);
344 num4 =
EClass.
rnd(num4 * 100 / (100 + num6 * 10 + 1));
347 CC.ModExp(302, CC.IsPC ? 20 : 100);
354 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) &&
EClass.
pc.
HasElement(1214))) &&
EClass.
rnd(5) != 0)
361 if (lang ==
"spell_hand")
363 string[] list2 =
Lang.
GetList(
"attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty(
"Touch") :
"Touch"));
364 string @ref =
"_elehand".lang(e.source.GetAltname(2), list2[4]);
365 CC.Say(c.
IsPCParty ?
"cast_hand_ally" :
"cast_hand", CC, c, @ref, c.
IsPCParty ? list2[1] : list2[2]);
369 CC.Say(lang +
"_hit", CC, c, e.
Name.ToLower());
372 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing !=
null) ?
EClass.
_map.
FindChara(actref.refThing.c_uidRefCard) :
null));
395 num4 = num4 * Act.powerMod / 100;
396 c.
DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
404 AddCon<ConGravity>(1, power);
405 AddCon<ConBlind>(4, power);
406 AddCon<ConDim>(5, power / 2);
407 AddCon<ConSupress>(3, power / 2);
408 if (actref.refThing !=
null && actref.refThing.id ==
"gun_gravity2")
410 AddCon<ConEntangle>(4, power / 3);
411 AddCon<ConSilence>(4, power / 3);
412 AddCon<ConWeakResEle>(4, power);
413 AddCon<ConNightmare>(4, power);
420 long num7 = num4 * num / 100;
421 Debug.Log(num4 +
" v:" + num7 +
" evalue:" + e.Value +
" power:" + power +
" elepMod:" + num);
427 CC.Chara.mana.Mod((
int)num7);
441 void AddCon<T>(
int rate,
int p2) where T :
Condition
455 num8 = ((actref.refThing !=
null) ? actref.refThing.material.hardness : (30 + power / 20));
458 num8 = CC.LV / 3 + 40;
462 num8 = 50 + power / 20;
466 bool flag3 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (
id == EffectId.Explosive && actref.refThing ==
null)) && !(EClass._zone is
Zone_Vernis);
502 p.
ModFire(-20, extinguish:
true);
507 foreach (
Card item2
in list)
523 bool flag2 = isNeg || flag;
540 if (list3.Count == 0)
544 CC.
Say(
"spell_earthquake", CC, element.
Name.ToLower());
554 DamageEle(CC,
id, power, element, list3, actRef,
"spell_earthquake");
563 if (list10.Count == 0)
567 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
577 DamageEle(CC,
id, power, element, list10, actRef,
"spell_ball");
586 if (list2.Count == 0)
588 list2.Add(tp.
Copy());
590 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
600 DamageEle(CC,
id, power, element, list2, actRef,
"spell_ball", tp);
608 List<Point> list4 =
new List<Point>();
609 list4.Add(tp.
Copy());
615 if (!
DamageEle(CC,
id, power, element, list4, actRef, (
id ==
EffectId.DrainBlood ||
id ==
EffectId.DrainMana) ?
"" : ((
id ==
EffectId.Sword) ?
"spell_sword" :
"spell_hand")))
617 CC.
Say(
"spell_hand_miss", CC, element.
Name.ToLower());
629 List<Point> list =
new List<Point>();
631 CC.
Say((
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow", CC, element.
Name.ToLower());
637 DamageEle(CC,
id, power, element, list, actRef, (
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow");
642 List<Point> list7 =
new List<Point>();
643 List<Point> list8 =
new List<Point> { tp.
Copy() };
650 foreach (
Card item2
in item.ListCards())
659 CC.
Say(
"spell_missile", CC, element.
Name.ToLower());
665 for (
int num9 = 0; num9 < 6 +
EClass.
rnd(7); num9++)
668 list7.Add(list8.RandomItem());
669 DamageEle(CC,
id, power, element, list7, actRef,
"spell_missile");
675 string n = actRef.n1;
676 if (!(n ==
"special"))
696 CC.
Say(
"summon_ally", CC);
706 CC.
Say(
"summon_ally_fail", CC);
709 string id3 = actRef.n1;
714 bool flag4 = actRef.n1 ==
"special";
722 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ?
EClass.
rnd(2) : 0);
729 case "special_force":
740 num3 = Mathf.Clamp(7 + CC.
LV / 100, 4, 20);
749 for (
int num6 = 0; num6 < num3; num6++)
757 if (point ==
null || !point.
IsValid)
765 CardBlueprint.current.lv = num5;
769 CardBlueprint.current.idEle = text;
836 if (!(n ==
"shadow"))
847 num8 = (CC.IsPCFactionOrMinion ? (CC.LV / 2) : (CC.
LV / 3 * 2));
851 num7 = chara2.LV * (100 + power / 10) / 100 + power / 30;
865 num7 = power / 10 + 1;
867 if (chara2.
LV < num7)
869 chara2.
SetLv((
int)num7);
877 if (!(n ==
"shadow"))
879 if (n ==
"special_force")
886 chara2.hp = chara2.MaxHP / 2;
889 if (actRef.n1 ==
"special2")
897 else if (!(actRef.n1 ==
"monster") || actRef.refThing ==
null)
909 CC.
Say(
"summon_ally_fail", CC);
918 CC.
Say(
"summon_ally_fail", CC);
921 CC.
Say(
"spell_funnel", CC, element.
Name.ToLower());
926 chara.
SetLv(Mathf.Abs(power) / 15);
936 if (list5.Count == 0)
940 CC.
Say(
"spell_breathe", CC, element.
Name.ToLower());
950 DamageEle(CC,
id, power, element, list5, actRef,
"spell_breathe");
977 float radius2 = ((
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))))));
978 if ((
id ==
EffectId.Explosive ||
id ==
EffectId.Rocket) && actRef.refThing !=
null)
980 radius2 = 2 + actRef.refThing.Evalue(666);
997 bool flag5 =
id == EffectId.Explosive ||
id == EffectId.Suicide ||
id ==
EffectId.Rocket;
999 if (list9.Count == 0)
1003 cc.
Say((
id ==
EffectId.Suicide) ?
"abSuicide" :
"spell_ball", cc, element.
Name.ToLower());
1009 tp.PlayEffect(
"flare");
1013 cc.PlaySound((id == EffectId.Flare) ?
"spell_flare" :
"spell_ball");
1020 DamageEle(actRef.origin ?? cc,
id, power, element, list9, actRef, (
id ==
EffectId.Suicide) ?
"suicide" :
"spell_ball");
1030 if (list6.Count == 0)
1034 CC.
Say(
"spell_bolt", CC, element.
Name.ToLower());
1044 DamageEle(CC,
id, power, element, list6, actRef,
"spell_bolt");
1054 CC.
Say(
"ab" +
id, CC);
1058 int id2 = ((
id ==
EffectId.Puddle) ? 4 : ((
id ==
EffectId.Bubble) ? 5 : ((
id ==
EffectId.MistOfDarkness) ? 6 : 7)));
1060 if (
id ==
EffectId.Bubble && CC.
id ==
"cancer")
1065 for (
int i = 0; i < num; i++)
1079 idEffect = idEffect,
1090 List<Card> list11 = tp.
ListCards().ToList();
1092 if (list11.Contains(CC))
1095 list11.Insert(0, CC);
1098 foreach (
Card item5
in list11)
1100 if (tc ==
null || item5 == tc)
1102 Proc(
id, power, state, CC, item5, actRef);
1103 if (flag2 && item5.
isChara && item5 != CC)
1105 CC.DoHostileAction(item5);
1107 if (actRef.refThing ==
null || !(actRef.refThing.trait is
TraitRod))
1112 if ((uint)(effectId - 200) <= 4u)
1121 CC.SayNothingHappans();
1140 int orgPower = power;
1141 if (blessed || flag)
1161 CC.
Say(
"escape", CC);
1167 if (CC.
id ==
"bell_silver")
1180 CC.
Say(
"burn_mana", CC);
1188 if (list2.Count == 0)
1196 item.PlayEffect(
"vanish");
1208 thing3.c_idRefCard =
"dog_mine";
1209 Zone.ignoreSpawnAnime =
true;
1213 case EffectId.LittleSisterMigration:
1216 bool flag2 =
id ==
EffectId.SilverCatMigration;
1222 List<Chara> list =
new List<Chara>();
1237 if (list.Count == 0)
1243 foreach (
Chara item2
in list)
1248 Msg.
Say(flag2 ?
"cat_migration" :
"little_migration", list.Count.ToString() ??
"");
1252 EClass.player.stats.catDepart += list.Count;
1255 EClass.player.stats.sistersDepart += list.Count;
1267 CC.
Say(
"abMagicMap_curse", CC);
1273 CC.
Say(
"abMagicMap", CC);
1291 Dice dice =
Dice.
Create(
"ActManaAbsorb", power, CC, (actRef.refThing !=
null) ? null : actRef.act);
1293 TC.PlaySound(
"heal");
1294 TC.PlayEffect(
"heal");
1297 CC.
Say(
"absorbMana", CC);
1309 TC.PlaySound(
"curse3");
1310 TC.PlayEffect(
"curse");
1311 TC.Say(
"forgetItems",
TC);
1312 int num8 = power / 50 + 1 +
EClass.
rnd(3);
1313 List<Thing> source =
TC.things.List((
Thing thing8) => thing8.c_IDTState == 0);
1314 for (
int num9 = 0; num9 < num8; num9++)
1316 source.RandomItem().c_IDTState = 5;
1325 bool armor =
id == EffectId.EnchantArmor ||
id ==
EffectId.EnchantArmorGreat;
1326 bool flag8 =
id == EffectId.EnchantWeaponGreat ||
id ==
EffectId.EnchantArmorGreat;
1336 cc.
Say(
"enc_curse", tc);
1340 int num10 = (flag8 ? 4 : 2) + (blessed ? 1 : 0);
1341 if (tc.
encLV >= num10)
1343 cc.
Say(
"enc_resist", tc);
1353 bool flag7 =
id ==
EffectId.GreaterIdentify;
1403 int num = (tc.isWeightChanged ? tc.c_weight : tc.
Thing.
source.weight);
1404 tc.isWeightChanged =
true;
1412 num = (int)(0.01f * (
float)num * (float)power * 0.75f + 500f);
1413 if (num < 0 || num > 10000000)
1431 cc.
Say(
"lighten_curse", tc);
1435 num = num * (100 - power / 10) / 100;
1453 cc.
Say(
"lighten", tc);
1477 cc.
Say(
"reconstruct", tc);
1478 EClass.game.cards.uidNext +=
EClass.
rnd(30);
1482 blesstedState = state
1485 thing2.genLv = num7;
1486 thing2.idSkin = tc.
idSkin;
1490 if (thing2.
id ==
"amulet_engagement" || thing2.
id ==
"ring_engagement")
1498 thing2.rarity =
Rarity.Mythical;
1503 CC.
Pick(thing2, msg:
false);
1510 case EffectId.ChangeMaterialLesser:
1512 case EffectId.ChangeMaterialGreater:
1524 string name2 = tc.
Name;
1527 bool num4 =
id ==
EffectId.ChangeMaterialGreater;
1528 bool flag6 =
id ==
EffectId.ChangeMaterialLesser;
1548 num5 = Mathf.Clamp(num5 +
EClass.
rnd(2), 0, 4);
1551 text = ((text ==
"metal") ?
"leather" :
"metal");
1554 for (
int num6 = 0; num6 < 1000; num6++)
1565 if ((tc.
id ==
"log" || tc.
id ==
"branch") && tc.material.alias ==
"carbone")
1581 cc.
Say(
"materialChanged", name2, row.GetName());
1604 string name = tc.
Name;
1607 bool flag5 = tc.rarity ==
Rarity.Legendary;
1610 rarity = (flag5 ? Rarity.Mythical :
Rarity.Legendary),
1621 foreach (
Element item4
in thing.elements.dict.Values.ToList().Shuffle())
1631 if ((uint)(id2 - 64) > 3u)
1637 if (flag5 && num2 >= 2)
1643 tc.isCrafted =
false;
1644 tc.rarity = (flag5 ? Rarity.Mythical :
Rarity.Legendary);
1654 c.
Say(
"reconstruct", c);
1661 List<string> list13 =
new List<string>();
1662 for (
int i = 0; i < 10; i++)
1664 list13.Add(AliasGen.GetRandomAlias());
1667 }, delegate(
int a,
string b)
1670 c.
Say(
"reconstruct", c);
1680 CC.
Say(
"reconstruct", CC);
1694 Dialog.
InputName(
"dialogVoidReturn".lang(max.ToString() ??
""), max.ToString() ??
"", delegate(
bool cancel,
string str)
1698 destLv = Mathf.Abs(str.ToInt());
1699 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1701 Debug.Log(destLv +
"/" + zone);
1707 Msg.
Say(
"returnComplete");
1708 EClass.player.uidLastTravelZone = 0;
1710 EClass.player.lastZonePos =
null;
1711 EClass.player.returnInfo =
null;
1738 Msg.
Say(
"returnNowhere");
1751 EClass.player.returnInfo =
null;
1766 else if (
id ==
EffectId.TeleportShort)
1821 Thing t =
ThingGen.
Create(
new string[6] {
"330",
"331",
"334",
"335",
"336",
"1142" }.RandomItem());
1827 List<Condition> list6 =
new List<Condition>();
1830 if (GetBlessingDifficulty(condition4) > 0 &&
EClass.
rnd(GetBlessingDifficulty(condition4)) == 0)
1832 list6.Add(condition4);
1835 if (list6.Count == 0)
1840 TC.pos.PlayEffect(
"holyveil");
1841 TC.pos.PlaySound(
"holyveil");
1842 TC.Say(
"unpolluted",
TC);
1875 TC.pos.PlayEffect(
"holyveil");
1876 TC.pos.PlaySound(
"holyveil");
1877 TC.pos.PlaySound(
"atk_eleSound");
1878 TC.conditions.ForeachReverse(delegate(
Condition condition4)
1885 TC.Say(
"abShutterHex",
TC);
1887 List<Chara> list10 =
TC.pos.ListCharasInRadius(
TC, 4, (
Chara chara3) => chara3 ==
TC || chara3.
IsHostile(CC));
1888 for (
int num23 = 0; num23 < num22; num23++)
1890 TweenUtil.Delay((
float)num23 * 0.1f, delegate
1894 foreach (
Chara item6
in list10)
1899 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1901 componentInChildren.startColor = startColor;
1903 TweenUtil.Delay((
float)num23 * 0.1f, delegate
1905 effect.
Play(center, 0f, pos);
1907 long dmg =
Dice.
Create(
"SpShutterHex", power, CC, (actRef.refThing !=
null) ? null : actRef.act).Roll();
1916 if (CC.
Dist(
TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion &&
TC.isRestrained))
1925 if (point ==
null || !CC.
CanSeeLos(point))
1929 CC.
Say(
"abDraw", CC,
TC);
1937 if (CC.
id ==
"tentacle")
1946 if (nearbyCatToSniff !=
null)
1948 CC.
Sniff(nearbyCatToSniff);
1958 if (
TC.Evalue(426) > 0)
1960 TC.Say((actRef.n1 ==
"money") ?
"abStealNegateMoney" :
"abStealNegate",
TC);
1963 Thing thing7 =
null;
1964 bool flag11 = actRef.n1 ==
"food";
1965 if (actRef.n1 ==
"money")
1977 Func<Thing, bool> func = (
Thing thing8) =>
true;
1980 func = (
Thing thing8) => thing8.IsFood;
1982 List<Thing> list12 =
TC.things.List(delegate(
Thing thing8)
1988 return thing8.trait.CanBeDestroyed && thing8.things.Count == 0 && thing8.invY != 1 && thing8.trait.CanBeStolen && !thing8.trait.CanOnlyCarry && !thing8.IsUnique && !thing8.isEquipped && thing8.blessedState == BlessedState.Normal && func(thing8);
1989 }, onlyAccessible:
true);
1990 if (list12.Count > 0)
1992 thing7 = list12.RandomItem();
1995 thing7 = thing7.
Split(1);
2002 CC.
Say(
"abStealNothing", CC,
TC);
2007 CC.
Pick(thing7, msg:
false);
2009 if (actRef.n1 ==
"food")
2018 CC.
Say(
"abStealEscape", CC);
2019 CC.
Teleport(GetTeleportPos(tc.
pos, 30), silent:
true);
2028 if (CC !=
null && CC !=
TC)
2030 TC.Say(
"curse", CC,
TC);
2032 TC.PlaySound(
"curse3");
2033 TC.PlayEffect(
"curse");
2034 if (
EClass.
rnd(150 +
TC.LUC * 5 +
TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) ||
TC.TryNullifyCurse())
2038 List<Thing> list4 =
TC.things.List(delegate(
Thing thing8)
2046 if (list4.Count == 0)
2051 Thing thing5 = list4.RandomItem();
2052 TC.Say(
"curse_hit",
TC, thing5);
2060 TC.Say(
"uncurseEQ" + (blessed ?
"_bless" : (flag ?
"_curse" :
"")),
TC);
2061 TC.PlaySound(
"uncurse");
2062 TC.PlayEffect(
"uncurse");
2070 List<Thing> list9 =
new List<Thing>();
2071 TC.things.Foreach(delegate(
Thing thing8)
2076 if (thing8.blessedState == BlessedState.Cursed)
2078 num26 = EClass.rnd(200);
2082 num26 = EClass.rnd(1000);
2088 if (
id ==
EffectId.UncurseEQGreater)
2094 TC.Say(
"uncurseEQ_success", thing8);
2098 TC.body.Unequip(thing8);
2110 foreach (
Thing item7
in list9)
2114 if (success == 0 && fail == 0)
2116 TC.SayNothingHappans();
2120 TC.Say(
"uncurseEQ_fail");
2126 string text2 = actRef.n1;
2131 if (!text3.IsEmpty())
2138 if (!actRef.aliasEle.IsEmpty())
2140 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
2143 condition.isPerfume = TC.IsPC && actRef.
isPerfume;
2144 Condition condition2 =
TC.AddCondition(condition);
2145 if (condition2 !=
null && condition2.
isPerfume)
2147 condition2.value = 3;
2150 if (!text3.IsEmpty())
2162 for (
int num21 = 0; num21 < 4 +
EClass.
rnd(2); num21++)
2181 bool isPowerful =
TC.IsPowerful;
2182 string n = actRef.n1;
2183 if (n ==
"ConSuffocation")
2185 power = power * 2 / 3;
2187 int num14 = TC.WIL * (isPowerful ? 20 : 5);
2189 if (condition3 !=
null)
2191 num14 += condition3.power * 5;
2197 int num16 = (TC.IsPowerful ? 40 : 90);
2206 if (condition3 !=
null)
2217 TC.Say(
"debuff_resist",
TC);
2226 if (!actRef.aliasEle.IsEmpty())
2230 (con as
ConMiasma)?.SetResistPenetrationLevel(
TC, CC);
2244 TC.MutateRandom(1, 100, ether:
false, state);
2251 TC.MutateRandom(-1, 100, ether:
false, state);
2271 if (blessed || flag)
2275 Dialog.
InputName(
"dialogWish",
"q", delegate(
bool cancel,
string text4)
2292 tc.
Say(
"faith_curse", tc,
faith.Name);
2297 tc.
Say(
"faith_bless", tc,
faith.Name);
2299 tc.
ModExp(306, power * 10);
2302 tc.
ModExp(85, power * 10);
2311 int gender2 = gender
switch
2325 if (blessed && age2 > 1)
2327 tc.
Say(
"ageDown", tc);
2332 tc.
Say(
"ageUp", tc);
2341 int num18 = ((actRef.refThing !=
null) ? actRef.refThing.GetInt(118) : actRef.refVal);
2347 num18 = EClass.game.seed + tc.
uid;
2351 tc.
Say(
"transBlood", tc);
2353 tc.c_bloodData =
null;
2366 List<Element> list3 =
new List<Element>();
2369 if (value.
source.category !=
"feat" || value.
id == 1644)
2373 switch (value.
source.categorySub)
2379 if (value.
vBase > 0)
2387 foreach (
Element item8
in list3)
2390 if (dNABonus < item8.
vBase)
2392 for (
int num12 = 0; num12 < item8.vBase - dNABonus; num12++)
2394 num11 += item8.
source.cost.TryGet(num12);
2399 EClass.pc.feat += num11;
2405 tc.
Say(
"resetFeat");
2413 if (!flag && age <= 0)
2418 age = Mathf.Max(0, age * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
2419 tc.
Say(flag ?
"ageUp" :
"ageDown", tc);
2437 tc.
Say(
"eternalYouth2", tc);
2451 tc.
Say(
"eternalYouth1", tc);
2452 tc.c_lockedAge = age3 + 1;
2464 Debug.Log(power +
"/" +
id.ToString() +
"/" + actRef.n1);
2475 else if (
id ==
EffectId.DebuffStats)
2480 if (power < 0 ||
id ==
EffectId.DebuffStats)
2482 power = Mathf.Abs(power);
2496 List<KeyValuePair<int, Chara>> list11 =
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();
2497 if (
TC.IsPCFaction ||
TC.IsPCFactionMinion)
2499 if (
TC.IsPC && list11.Count == 0)
2503 if (list11.Count > 0)
2505 list11.RandomItem().Value.Chara.GetRevived();
2509 TC.SayNothingHappans();
2518 bool flag9 =
id == EffectId.DamageBody ||
id ==
EffectId.DamageBodyGreat;
2519 bool mind =
id == EffectId.DamageMind ||
id ==
EffectId.DamageMindGreat;
2520 int num19 = ((
id == EffectId.DamageBody ||
id ==
EffectId.DamageMind) ? 1 : (4 +
EClass.
rnd(4)));
2529 TC.PlayEffect(
"debuff");
2530 TC.PlaySound(
"debuff");
2532 TC.Say(flag9 ?
"damageBody" :
"damageMind",
TC);
2533 for (
int num20 = 0; num20 < num19; num20++)
2535 TC.DamageTempElements(power, flag9, mind,
id !=
EffectId.Weaken);
2548 bool flag10 =
id == EffectId.EnhanceBody ||
id ==
EffectId.EnhanceBodyGreat;
2549 bool mind2 =
id == EffectId.EnhanceMind ||
id ==
EffectId.EnhanceMindGreat;
2554 TC.Say(flag10 ?
"enhanceBody" :
"enhanceMind",
TC);
2555 TC.PlayEffect(
"buff");
2556 TC.PlaySound(
"buff");
2557 TC.EnhanceTempElements(power, flag10, mind2, onlyRenew:
true);
2563 bool flag12 =
id ==
EffectId.RestoreBody;
2569 TC.Say(flag12 ?
"restoreBody" :
"restoreMind",
TC);
2570 TC.PlaySound(
"heal");
2571 TC.PlayEffect(
"heal");
2581 TC.CureHost(
CureType.HealComplete, power, state);
2582 TC.Say(
"heal_heavy",
TC);
2587 long num13 =
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();
2588 if (actRef.refThing !=
null)
2590 num13 = num13 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2594 TC.DamageHP(num13 / 2, 919, power);
2600 num13 += TC.MaxHP / 4;
2607 TC.HealHPHost(num13, (actRef.refThing ==
null) ? HealSource.Magic :
HealSource.Item);
2610 TC.Say((power >= 300) ?
"heal_heavy" :
"heal_light",
TC);
2616 TC.Say(
"heal_jure",
TC);
2630 IList<Condition> list5 =
TC.conditions.Copy();
2642 CC.
Say(
"removeHex",
TC, item9.
Name.ToLower());
2651 CC.
Say(
"removeHex_fail",
TC, item9.
Name.ToLower());
2665 TC.PlaySound(
"heal");
2666 TC.PlayEffect(
"heal");
2669 TC.Say(
"cureCorruption_curse",
TC);
2671 TC.ModCorruption(power);
2675 TC.Say(
"cureCorruption",
TC);
2676 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2687 chara.c_altName = TC.c_altName ??
TC.source.GetName(
TC);
2699 TC.Say(
"drinkRamune",
TC);
2703 TC.Say(
"drinkGood",
TC);
2709 TC.Say(
"drinkMilk",
TC);
2726 TC.Say(
"drinkWater_dirty",
TC);
2732 TC.Say(
"drinkWater_clear",
TC);
2738 TC.Say(
"drinkWater_dirty",
TC);
2746 if (
TC.HasElement(1211))
2748 TC.Say(
"drinkSaltWater_snail",
TC);
2749 int num17 = ((TC.hp > 10) ? (
TC.hp -
EClass.
rnd(10)) : 10000);
2754 TC.Say(
"drinkSaltWater",
TC);
2759 if (
TC.HasElement(1215))
2761 TC.Say(
"drunk_dwarf",
TC);
2875 TC.PlayEffect(
"buff");
2876 TC.PlaySound(
"offering");
2877 int num24 =
TC.Evalue(1423);
2881 if (flag && num24 > 1)
2885 else if (num24 < 15)
2887 num25 = ((!blessed) ? 1 : 2);
2888 if (num25 + num24 > 15)
2895 TC.SetFeat(1423, num24 + num25, msg:
true);
2896 TC.SetInt(134,
TC.GetInt(134) + num25);
2945 if (list8.Count != 0)
2947 Thing thing6 = list8.RandomItem();
2948 TC.Say(
"acid_hit",
TC);
2951 TC.Say(
"acid_nullify", thing6);
2953 else if (thing6.
encLV > -5)
2955 TC.Say(
"acid_rust",
TC, thing6);
2967 TC.DamageHP(power / 5, actRef.idEle, power);
2978 TC.Say(
"drink_acid",
TC);
2979 TC.DamageHP(power / 5, 923, power);
2982 Msg.
Say(
"nothingHappens");
2990 TC.Say(
"love_curse_self",
TC);
2994 TC.Say(
"love_curse", CC,
TC);
2995 TC.ModAffinity(CC, -power / 4, show:
false);
2997 TC.ShowEmo(
Emo.angry);
3001 LoveMiracle(
TC, CC, power,
id, state);
3007 if (
TC.HasElement(1532))
3009 TC.SetMutation(1532);
3013 TC.SetMutation(1533, 1);
3020 if (
TC.HasElement(1533))
3022 TC.SetMutation(1533);
3026 TC.SetMutation(1532, 1);
3029 TC.PlayEffect(
"aura_heaven");
3030 TC.PlaySound(
"godbless");
3033 TC.Say(
"grow_hair_fail",
TC);
3036 TC.Say(
"grow_hair",
TC);
3043 int GetBlessingDifficulty(
Condition condition4)
3053 if (!CC.IsHostile(
TC))
3073 Proc(_id, orgPower, _state, cc, tc, _ref1);
3079 tc.
Say(
"eat_poison", tc);
3081 if (power > 100000000)
3085 int num = (int)Mathf.Sqrt(power * 100);
3097 tc.
Say(
"love_ground", tc);
3101 tc.
Say(
"love_chara", c, tc);
3110 tc.
Say(
"item_drop", thing);
3114 Thing c2 = tc.
MakeMilk(effect:
true, 1, addToZone:
true, state);
3115 tc.
Say(
"item_drop", c2);
3119 Thing c3 = tc.
MakeEgg(effect:
true, 1, addToZone:
true, (idEffect ==
EffectId.LovePlus) ? 3 : 20, state);
3120 tc.
Say(
"item_drop", c3);
3134 tc.
Say(
"love_ground", tc);
3138 tc.
Say(
"love_chara", c, tc);
3147 for (
int i = 0; i < 10000; i++)
3162 for (
int i = 0; i <= maxOffset; i++)
3164 int destDist2 = destDist + i;
3166 list.RemoveAll((
Point p) => !ValidPos(p));
3169 return list.RandomItem();
3175 destDist2 = destDist - i;
3179 list.RemoveAll((
Point p) => !ValidPos(p));
3182 return list.RandomItem();
3186 return GetTeleportPos(org);
3187 static bool ValidPos(
Point p)
3200 string netMsg =
GameLang.
Parse(
"wish".langGame(), thirdPerson:
true, name, s);
3201 List<WishItem> list =
new List<WishItem>();
3202 long wishLv = 10 + power / 4;
3206 wishLv = wishLv * 150 / 100;
3210 wishLv = wishLv * 150 / 100;
3213 Debug.Log(power +
"/" + wishValue);
3214 string _s = s.ToLower();
3222 if (
item.giftRank >= 2 &&
item.IsValidArtifact(r.
id))
3249 string text = r.
GetName().ToLower();
3250 int score =
Compare(_s, text);
3263 if (category.IsChildOf(
"weapon") || category.IsChildOf(
"armor") || category.IsChildOf(
"ranged"))
3265 CardBlueprint.SetRarity(Rarity.Legendary);
3270 bool flag2 = thing.trait is
TraitDeed || thing.rarity >=
Rarity.Artifact || thing.
source._origin ==
"artifact_summon";
3274 thing.c_charges = 0;
3277 num = EClass.rndHalf(wishValue * 3);
3280 num = EClass.rndHalf(wishValue / 500 + 4);
3283 num = EClass.rndHalf(wishValue / 500 + 4);
3286 num = EClass.rndHalf(wishValue / 2000 + 4);
3289 if (!flag2 && thing.trait.CanStack)
3291 int num2 = wishValue;
3293 for (int i = 1; i < 1000; i++)
3295 int num3 = price + i * 2 * (price + 500);
3296 if (num3 > 0 && num2 > num3)
3305 if (price > 2500 && num > 3)
3307 num = 3 + (int)Mathf.Sqrt(num - 3);
3309 if (price > 5000 && num > 2)
3311 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
3313 if (price > 10000 && num > 1)
3315 num = 1 + Mathf.Min((
int)Mathf.Sqrt(num - 1) / 3, 2);
3322 Debug.Log(_s +
"/" + num +
"/" + score);
3323 if (thing.HasTag(
CTAG.godArtifact))
3337 if (list.Count == 0)
3339 netMsg = netMsg + Lang.space +
"wishFail".langGame();
3344 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3345 foreach (WishItem item2
in list)
3347 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 int Compare(string s, string t)
static void TryDelay(Action a)
static Point GetShortTeleportPos(Point org, Point targetPos, int destDist, int maxOffset=6)
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 Point GetTeleportPos(Point org, int radius=6, Chara target=null)
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)
void Refresh(bool calledRecursive=false)
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()
void SetFeat(int id, int value=1, bool msg=false)
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 RefreshFaithElement()
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)
Chara SetHostility(Hostility h)
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 long RollMax(int num, int sides, int bonus=0)
static long 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)
static void SetDirtyAll(bool immediate=false)
Layer SetTitles(string langList, string idHeaderRow=null)
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=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 > ListPointsOnEdge(Point center, int destDist, bool mustBeWalkable=true, bool los=true)
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)
void Launch(Vector2 from, Vector2 to)
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)
ref Vector3 PositionCenter()
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)