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 (list5.Count == 0)
544 CC.
Say(
"spell_earthquake", CC, element.
Name.ToLower());
554 DamageEle(CC,
id, power, element, list5, actRef,
"spell_earthquake");
563 if (list3.Count == 0)
567 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
577 DamageEle(CC,
id, power, element, list3, actRef,
"spell_ball");
586 if (list9.Count == 0)
588 list9.Add(tp.
Copy());
590 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
600 DamageEle(CC,
id, power, element, list9, 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> list7 =
new List<Point>();
630 list7.Add(tp.
Copy());
631 CC.
Say((
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow", CC, element.
Name.ToLower());
637 DamageEle(CC,
id, power, element, list7, actRef, (
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow");
642 List<Point> list =
new List<Point>();
643 List<Point> list2 =
new List<Point> { tp.
Copy() };
650 foreach (
Card item2
in item.ListCards())
659 CC.
Say(
"spell_missile", CC, element.
Name.ToLower());
665 for (
int num3 = 0; num3 < 6 +
EClass.
rnd(7); num3++)
668 list.Add(list2.RandomItem());
669 DamageEle(CC,
id, power, element, list, 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 flag5 = actRef.n1 ==
"special";
722 num4 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ?
EClass.
rnd(2) : 0);
729 case "special_force":
740 num4 = Mathf.Clamp(7 + CC.
LV / 100, 4, 20);
749 for (
int num7 = 0; num7 < num4; num7++)
757 if (point ==
null || !point.
IsValid)
765 CardBlueprint.current.lv = num6;
769 CardBlueprint.current.idEle = text;
836 if (!(n ==
"shadow"))
847 num9 = (CC.IsPCFactionOrMinion ? (CC.LV / 2) : (CC.
LV / 3 * 2));
851 num8 = chara2.LV * (100 + power / 10) / 100 + power / 30;
865 num8 = power / 10 + 1;
867 if (chara2.
LV < num8)
869 chara2.
SetLv((
int)num8);
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 (list6.Count == 0)
940 CC.
Say(
"spell_breathe", CC, element.
Name.ToLower());
950 DamageEle(CC,
id, power, element, list6, actRef,
"spell_breathe");
977 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))))));
978 if ((
id ==
EffectId.Explosive ||
id ==
EffectId.Rocket) && actRef.refThing !=
null)
980 radius = 2 + actRef.refThing.Evalue(666);
998 bool flag3 =
id == EffectId.Explosive ||
id == EffectId.Suicide ||
id ==
EffectId.Rocket;
1000 if (list10.Count == 0)
1004 cc.
Say((
id ==
EffectId.Suicide) ?
"abSuicide" :
"spell_ball", cc, element.
Name.ToLower());
1010 tp.PlayEffect(
"flare");
1014 cc.PlaySound((id == EffectId.Flare) ?
"spell_flare" :
"spell_ball");
1021 DamageEle(actRef.origin ?? cc,
id, power, element, list10, actRef, (
id ==
EffectId.Suicide) ?
"suicide" :
"spell_ball");
1022 cc.
SetBool(137, enable:
false);
1032 if (list8.Count == 0)
1036 CC.
Say(
"spell_bolt", CC, element.
Name.ToLower());
1046 DamageEle(CC,
id, power, element, list8, actRef,
"spell_bolt");
1056 CC.
Say(
"ab" +
id, CC);
1060 int id2 = ((
id ==
EffectId.Puddle) ? 4 : ((
id ==
EffectId.Bubble) ? 5 : ((
id ==
EffectId.MistOfDarkness) ? 6 : 7)));
1062 if (
id ==
EffectId.Bubble && CC.
id ==
"cancer")
1067 for (
int i = 0; i < num; i++)
1081 idEffect = idEffect,
1094 if (list11.Contains(CC))
1097 list11.Insert(0, CC);
1100 foreach (
Card item5
in list11)
1102 if (tc ==
null || item5 == tc)
1104 Proc(
id, power, state, CC, item5, actRef);
1105 if (flag2 && item5.
isChara && item5 != CC)
1107 CC.DoHostileAction(item5);
1109 if (actRef.refThing ==
null || !(actRef.refThing.trait is
TraitRod))
1114 if ((uint)(effectId - 200) <= 4u)
1123 CC.SayNothingHappans();
1142 int orgPower = power;
1143 if (blessed || flag)
1163 CC.
Say(
"escape", CC);
1169 if (CC.
id ==
"bell_silver")
1182 CC.
Say(
"burn_mana", CC);
1190 if (list.Count == 0)
1198 item.PlayEffect(
"vanish");
1210 thing4.c_idRefCard =
"dog_mine";
1211 Zone.ignoreSpawnAnime =
true;
1215 case EffectId.LittleSisterMigration:
1218 bool flag5 =
id ==
EffectId.SilverCatMigration;
1224 List<Chara> list2 =
new List<Chara>();
1239 if (list2.Count == 0)
1245 foreach (
Chara item2
in list2)
1250 Msg.
Say(flag5 ?
"cat_migration" :
"little_migration", list2.Count.ToString() ??
"");
1254 EClass.player.stats.catDepart += list2.Count;
1257 EClass.player.stats.sistersDepart += list2.Count;
1269 CC.
Say(
"abMagicMap_curse", CC);
1275 CC.
Say(
"abMagicMap", CC);
1293 Dice dice =
Dice.
Create(
"ActManaAbsorb", power, CC, (actRef.refThing !=
null) ? null : actRef.act);
1295 TC.PlaySound(
"heal");
1296 TC.PlayEffect(
"heal");
1299 CC.
Say(
"absorbMana", CC);
1311 TC.PlaySound(
"curse3");
1312 TC.PlayEffect(
"curse");
1313 TC.Say(
"forgetItems",
TC);
1314 int num11 = power / 50 + 1 +
EClass.
rnd(3);
1315 List<Thing> source =
TC.things.List((
Thing thing8) => thing8.c_IDTState == 0);
1316 for (
int num12 = 0; num12 < num11; num12++)
1318 source.RandomItem().c_IDTState = 5;
1327 bool armor =
id == EffectId.EnchantArmor ||
id ==
EffectId.EnchantArmorGreat;
1328 bool flag7 =
id == EffectId.EnchantWeaponGreat ||
id ==
EffectId.EnchantArmorGreat;
1338 cc.
Say(
"enc_curse", tc);
1342 int num13 = (flag7 ? 4 : 2) + (blessed ? 1 : 0);
1343 if (tc.
encLV >= num13)
1345 cc.
Say(
"enc_resist", tc);
1355 bool flag8 =
id ==
EffectId.GreaterIdentify;
1405 int num = (tc.isWeightChanged ? tc.c_weight : tc.
Thing.
source.weight);
1406 tc.isWeightChanged =
true;
1412 int num2 = (blessed ? (power / 4) : power);
1413 int num3 = Mathf.Clamp(Mathf.Max(orCreateElement3.
vBase - tc.
encLV, orCreateElement4.
vBase) * num2 / 1000, 1, 5);
1414 int num4 = Mathf.Clamp(Mathf.Max(orCreateElement2.
vBase - tc.
encLV * 2, orCreateElement.
vBase) * num2 / 1000, 1, 5);
1417 num = (int)(0.01f * (
float)num * (float)power * 0.75f + 500f);
1418 if (num < 0 || num > 10000000)
1436 cc.
Say(
"lighten_curse", tc);
1440 num = num * (100 - power / 10) / 100;
1454 cc.
Say(
"lighten", tc);
1478 cc.
Say(
"reconstruct", tc);
1479 EClass.game.cards.uidNext +=
EClass.
rnd(30);
1483 blesstedState = state
1486 thing2.genLv = num10;
1487 thing2.idSkin = tc.
idSkin;
1491 if (thing2.
id ==
"amulet_engagement" || thing2.
id ==
"ring_engagement")
1499 thing2.rarity =
Rarity.Mythical;
1504 CC.
Pick(thing2, msg:
false);
1511 case EffectId.ChangeMaterialLesser:
1513 case EffectId.ChangeMaterialGreater:
1525 string name2 = tc.
Name;
1528 bool num7 =
id ==
EffectId.ChangeMaterialGreater;
1529 bool flag4 =
id ==
EffectId.ChangeMaterialLesser;
1549 num8 = Mathf.Clamp(num8 +
EClass.
rnd(2), 0, 4);
1552 text = ((text ==
"metal") ?
"leather" :
"metal");
1555 for (
int num9 = 0; num9 < 1000; num9++)
1566 if ((tc.
id ==
"log" || tc.
id ==
"branch") && tc.material.alias ==
"carbone")
1582 cc.
Say(
"materialChanged", name2, row.GetName());
1605 string name = tc.
Name;
1608 bool flag3 = tc.rarity ==
Rarity.Legendary;
1611 rarity = (flag3 ? Rarity.Mythical :
Rarity.Legendary),
1622 foreach (
Element item4
in thing.elements.dict.Values.ToList().Shuffle())
1632 if ((uint)(id2 - 64) > 3u)
1638 if (flag3 && num5 >= 2)
1644 tc.isCrafted =
false;
1645 tc.rarity = (flag3 ? Rarity.Mythical :
Rarity.Legendary);
1655 c.
Say(
"reconstruct", c);
1662 List<string> list13 =
new List<string>();
1663 for (
int i = 0; i < 10; i++)
1665 list13.Add(AliasGen.GetRandomAlias());
1668 }, delegate(
int a,
string b)
1671 c.
Say(
"reconstruct", c);
1681 CC.
Say(
"reconstruct", CC);
1695 Dialog.
InputName(
"dialogVoidReturn".lang(max.ToString() ??
""), max.ToString() ??
"", delegate(
bool cancel,
string str)
1699 destLv = Mathf.Abs(str.ToInt());
1700 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1702 Debug.Log(destLv +
"/" + zone);
1708 Msg.
Say(
"returnComplete");
1709 EClass.player.uidLastTravelZone = 0;
1711 EClass.player.lastZonePos =
null;
1712 EClass.player.returnInfo =
null;
1739 Msg.
Say(
"returnNowhere");
1752 EClass.player.returnInfo =
null;
1767 else if (
id ==
EffectId.TeleportShort)
1822 Thing t =
ThingGen.
Create(
new string[6] {
"330",
"331",
"334",
"335",
"336",
"1142" }.RandomItem());
1828 List<Condition> list6 =
new List<Condition>();
1831 if (GetBlessingDifficulty(condition4) > 0 &&
EClass.
rnd(GetBlessingDifficulty(condition4)) == 0)
1833 list6.Add(condition4);
1836 if (list6.Count == 0)
1841 TC.pos.PlayEffect(
"holyveil");
1842 TC.pos.PlaySound(
"holyveil");
1843 TC.Say(
"unpolluted",
TC);
1876 TC.pos.PlayEffect(
"holyveil");
1877 TC.pos.PlaySound(
"holyveil");
1878 TC.pos.PlaySound(
"atk_eleSound");
1879 TC.conditions.ForeachReverse(delegate(
Condition condition4)
1886 TC.Say(
"abShutterHex",
TC);
1888 List<Chara> list10 =
TC.pos.ListCharasInRadius(
TC, 4, (
Chara chara3) => chara3 ==
TC || chara3.
IsHostile(CC));
1889 for (
int num26 = 0; num26 < num25; num26++)
1891 TweenUtil.Delay((
float)num26 * 0.1f, delegate
1895 foreach (
Chara item6
in list10)
1900 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1902 componentInChildren.startColor = startColor;
1904 TweenUtil.Delay((
float)num26 * 0.1f, delegate
1906 effect.
Play(center, 0f, pos);
1908 long dmg =
Dice.
Create(
"SpShutterHex", power, CC, (actRef.refThing !=
null) ? null : actRef.act).Roll();
1917 if (CC.
Dist(
TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion &&
TC.isRestrained))
1926 if (point ==
null || !CC.
CanSeeLos(point))
1930 CC.
Say(
"abDraw", CC,
TC);
1938 if (CC.
id ==
"tentacle")
1947 if (nearbyCatToSniff !=
null)
1949 CC.
Sniff(nearbyCatToSniff);
1959 if (
TC.Evalue(426) > 0)
1961 TC.Say((actRef.n1 ==
"money") ?
"abStealNegateMoney" :
"abStealNegate",
TC);
1964 Thing thing7 =
null;
1965 bool flag11 = actRef.n1 ==
"food";
1966 if (actRef.n1 ==
"money")
1978 Func<Thing, bool> func = (
Thing thing8) =>
true;
1981 func = (
Thing thing8) => thing8.IsFood;
1983 List<Thing> list12 =
TC.things.List(delegate(
Thing thing8)
1989 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);
1990 }, onlyAccessible:
true);
1991 if (list12.Count > 0)
1993 thing7 = list12.RandomItem();
1996 thing7 = thing7.
Split(1);
2003 CC.
Say(
"abStealNothing", CC,
TC);
2008 CC.
Pick(thing7, msg:
false);
2010 if (actRef.n1 ==
"food")
2019 CC.
Say(
"abStealEscape", CC);
2020 CC.
Teleport(GetTeleportPos(tc.
pos, 30), silent:
true);
2029 if (CC !=
null && CC !=
TC)
2031 TC.Say(
"curse", CC,
TC);
2033 TC.PlaySound(
"curse3");
2034 TC.PlayEffect(
"curse");
2035 if (
EClass.
rnd(150 +
TC.LUC * 5 +
TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) ||
TC.TryNullifyCurse())
2039 List<Thing> list4 =
TC.things.List(delegate(
Thing thing8)
2047 if (list4.Count == 0)
2052 Thing thing5 = list4.RandomItem();
2053 TC.Say(
"curse_hit",
TC, thing5);
2061 TC.Say(
"uncurseEQ" + (blessed ?
"_bless" : (flag ?
"_curse" :
"")),
TC);
2062 TC.PlaySound(
"uncurse");
2063 TC.PlayEffect(
"uncurse");
2071 List<Thing> list9 =
new List<Thing>();
2072 TC.things.Foreach(delegate(
Thing thing8)
2077 if (thing8.blessedState == BlessedState.Cursed)
2079 num29 = EClass.rnd(200);
2083 num29 = EClass.rnd(1000);
2089 if (
id ==
EffectId.UncurseEQGreater)
2095 TC.Say(
"uncurseEQ_success", thing8);
2099 TC.body.Unequip(thing8);
2111 foreach (
Thing item7
in list9)
2115 if (success == 0 && fail == 0)
2117 TC.SayNothingHappans();
2121 TC.Say(
"uncurseEQ_fail");
2127 string text2 = actRef.n1;
2132 if (!text3.IsEmpty())
2139 if (!actRef.aliasEle.IsEmpty())
2141 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
2144 condition.isPerfume = TC.IsPC && actRef.
isPerfume;
2145 Condition condition2 =
TC.AddCondition(condition, CC);
2146 if (condition2 !=
null && condition2.
isPerfume)
2148 condition2.value = 3;
2151 if (!text3.IsEmpty())
2163 for (
int num24 = 0; num24 < 4 +
EClass.
rnd(2); num24++)
2182 bool isPowerful =
TC.IsPowerful;
2183 string n = actRef.n1;
2184 if (n ==
"ConSuffocation")
2186 power = power * 2 / 3;
2188 int num17 = TC.WIL * (isPowerful ? 20 : 5);
2190 if (condition3 !=
null)
2192 num17 += condition3.power * 5;
2198 int num19 = (TC.IsPowerful ? 40 : 90);
2207 if (condition3 !=
null)
2218 TC.Say(
"debuff_resist",
TC);
2227 if (!actRef.aliasEle.IsEmpty())
2231 (con as
ConMiasma)?.SetResistPenetrationLevel(
TC, CC);
2245 TC.MutateRandom(1, 100, ether:
false, state);
2252 TC.MutateRandom(-1, 100, ether:
false, state);
2272 if (blessed || flag)
2276 Dialog.
InputName(
"dialogWish",
"q", delegate(
bool cancel,
string text4)
2293 tc.
Say(
"faith_curse", tc,
faith.Name);
2298 tc.
Say(
"faith_bless", tc,
faith.Name);
2300 tc.
ModExp(306, power * 10);
2303 tc.
ModExp(85, power * 10);
2312 int gender2 = gender
switch
2326 if (blessed && age2 > 1)
2328 tc.
Say(
"ageDown", tc);
2333 tc.
Say(
"ageUp", tc);
2342 int num21 = ((actRef.refThing !=
null) ? actRef.refThing.GetInt(118) : actRef.refVal);
2348 num21 = EClass.game.seed + tc.
uid;
2352 tc.
Say(
"transBlood", tc);
2354 tc.c_bloodData =
null;
2367 List<Element> list3 =
new List<Element>();
2370 if (value.
source.category !=
"feat" || value.
id == 1644)
2374 switch (value.
source.categorySub)
2380 if (value.
vBase > 0)
2388 foreach (
Element item8
in list3)
2391 if (dNABonus < item8.
vBase)
2393 for (
int num15 = 0; num15 < item8.vBase - dNABonus; num15++)
2395 num14 += item8.
source.cost.TryGet(num15);
2400 EClass.pc.feat += num14;
2406 tc.
Say(
"resetFeat");
2414 if (!flag && age <= 0)
2419 age = Mathf.Max(0, age * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
2420 tc.
Say(flag ?
"ageUp" :
"ageDown", tc);
2438 tc.
Say(
"eternalYouth2", tc);
2452 tc.
Say(
"eternalYouth1", tc);
2453 tc.c_lockedAge = age3 + 1;
2465 Debug.Log(power +
"/" +
id.ToString() +
"/" + actRef.n1);
2476 else if (
id ==
EffectId.DebuffStats)
2481 if (power < 0 ||
id ==
EffectId.DebuffStats)
2483 power = Mathf.Abs(power);
2497 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();
2498 if (
TC.IsPCFaction ||
TC.IsPCFactionMinion)
2500 if (
TC.IsPC && list11.Count == 0)
2504 if (list11.Count > 0)
2506 list11.RandomItem().Value.Chara.GetRevived();
2510 TC.SayNothingHappans();
2519 bool flag9 =
id == EffectId.DamageBody ||
id ==
EffectId.DamageBodyGreat;
2520 bool mind =
id == EffectId.DamageMind ||
id ==
EffectId.DamageMindGreat;
2521 int num22 = ((
id == EffectId.DamageBody ||
id ==
EffectId.DamageMind) ? 1 : (4 +
EClass.
rnd(4)));
2530 TC.PlayEffect(
"debuff");
2531 TC.PlaySound(
"debuff");
2533 TC.Say(flag9 ?
"damageBody" :
"damageMind",
TC);
2534 for (
int num23 = 0; num23 < num22; num23++)
2536 TC.DamageTempElements(power, flag9, mind,
id !=
EffectId.Weaken);
2549 bool flag10 =
id == EffectId.EnhanceBody ||
id ==
EffectId.EnhanceBodyGreat;
2550 bool mind2 =
id == EffectId.EnhanceMind ||
id ==
EffectId.EnhanceMindGreat;
2555 TC.Say(flag10 ?
"enhanceBody" :
"enhanceMind",
TC);
2556 TC.PlayEffect(
"buff");
2557 TC.PlaySound(
"buff");
2558 TC.EnhanceTempElements(power, flag10, mind2, onlyRenew:
true);
2564 bool flag12 =
id ==
EffectId.RestoreBody;
2570 TC.Say(flag12 ?
"restoreBody" :
"restoreMind",
TC);
2571 TC.PlaySound(
"heal");
2572 TC.PlayEffect(
"heal");
2582 TC.CureHost(
CureType.HealComplete, power, state);
2583 TC.Say(
"heal_heavy",
TC);
2588 long num16 =
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();
2589 if (actRef.refThing !=
null)
2591 num16 = num16 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2593 num16 = num16 * Mathf.Max(100 + CC.
Evalue(413), 0) / 100;
2596 TC.DamageHP(num16 / 2, 919, power);
2602 num16 += TC.MaxHP / 4;
2609 TC.HealHPHost(num16, (actRef.refThing ==
null) ? HealSource.Magic :
HealSource.Item);
2612 TC.Say((power >= 300) ?
"heal_heavy" :
"heal_light",
TC);
2618 TC.Say(
"heal_jure",
TC);
2632 IList<Condition> list5 =
TC.conditions.Copy();
2644 CC.
Say(
"removeHex",
TC, item9.
Name.ToLower());
2653 CC.
Say(
"removeHex_fail",
TC, item9.
Name.ToLower());
2667 TC.PlaySound(
"heal");
2668 TC.PlayEffect(
"heal");
2671 TC.Say(
"cureCorruption_curse",
TC);
2673 TC.ModCorruption(power);
2677 TC.Say(
"cureCorruption",
TC);
2678 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2689 chara.c_altName = TC.c_altName ??
TC.source.GetName(
TC);
2701 TC.Say(
"drinkRamune",
TC);
2705 TC.Say(
"drinkGood",
TC);
2711 TC.Say(
"drinkMilk",
TC);
2728 TC.Say(
"drinkWater_dirty",
TC);
2734 TC.Say(
"drinkWater_clear",
TC);
2740 TC.Say(
"drinkWater_dirty",
TC);
2748 if (
TC.HasElement(1211))
2750 TC.Say(
"drinkSaltWater_snail",
TC);
2751 int num20 = ((TC.hp > 10) ? (
TC.hp -
EClass.
rnd(10)) : 10000);
2756 TC.Say(
"drinkSaltWater",
TC);
2761 if (
TC.HasElement(1215))
2763 TC.Say(
"drunk_dwarf",
TC);
2877 TC.PlayEffect(
"buff");
2878 TC.PlaySound(
"offering");
2879 int num27 =
TC.Evalue(1423);
2883 if (flag && num27 > 1)
2887 else if (num27 < 15)
2889 num28 = ((!blessed) ? 1 : 2);
2890 if (num28 + num27 > 15)
2897 TC.SetFeat(1423, num27 + num28, msg:
true);
2898 TC.SetInt(134,
TC.GetInt(134) + num28);
2947 if (list8.Count != 0)
2949 Thing thing6 = list8.RandomItem();
2950 TC.Say(
"acid_hit",
TC);
2953 TC.Say(
"acid_nullify", thing6);
2955 else if (thing6.
encLV > -5)
2957 TC.Say(
"acid_rust",
TC, thing6);
2969 TC.DamageHP(power / 5, actRef.idEle, power);
2980 TC.Say(
"drink_acid",
TC);
2981 TC.DamageHP(power / 5, 923, power);
2984 Msg.
Say(
"nothingHappens");
2992 TC.Say(
"love_curse_self",
TC);
2996 TC.Say(
"love_curse", CC,
TC);
2997 TC.ModAffinity(CC, -power / 4, show:
false);
2999 TC.ShowEmo(
Emo.angry);
3003 LoveMiracle(
TC, CC, power,
id, state);
3009 if (
TC.HasElement(1532))
3011 TC.SetMutation(1532);
3015 TC.SetMutation(1533, 1);
3022 if (
TC.HasElement(1533))
3024 TC.SetMutation(1533);
3028 TC.SetMutation(1532, 1);
3031 TC.PlayEffect(
"aura_heaven");
3032 TC.PlaySound(
"godbless");
3035 TC.Say(
"grow_hair_fail",
TC);
3038 TC.Say(
"grow_hair",
TC);
3045 int GetBlessingDifficulty(
Condition condition4)
3055 if (!CC.IsHostile(
TC))
3075 Proc(_id, orgPower, _state, cc, tc, _ref1);
3081 tc.
Say(
"eat_poison", tc);
3083 if (power > 100000000)
3087 int num = (int)Mathf.Sqrt(power * 100);
3099 tc.
Say(
"love_ground", tc);
3103 tc.
Say(
"love_chara", c, tc);
3112 tc.
Say(
"item_drop", thing);
3116 Thing c2 = tc.
MakeMilk(effect:
true, 1, addToZone:
true, state);
3117 tc.
Say(
"item_drop", c2);
3121 Thing c3 = tc.
MakeEgg(effect:
true, 1, addToZone:
true, (idEffect ==
EffectId.LovePlus) ? 3 : 20, state);
3122 tc.
Say(
"item_drop", c3);
3136 tc.
Say(
"love_ground", tc);
3140 tc.
Say(
"love_chara", c, tc);
3149 for (
int i = 0; i < 10000; i++)
3164 for (
int i = 0; i <= maxOffset; i++)
3166 int destDist2 = destDist + i;
3168 list.RemoveAll((
Point p) => !ValidPos(p));
3171 return list.RandomItem();
3177 destDist2 = destDist - i;
3181 list.RemoveAll((
Point p) => !ValidPos(p));
3184 return list.RandomItem();
3188 return GetTeleportPos(org);
3189 static bool ValidPos(
Point p)
3202 string netMsg =
GameLang.
Parse(
"wish".langGame(), thirdPerson:
true, name, s);
3203 List<WishItem> list =
new List<WishItem>();
3204 long wishLv = 10 + power / 4;
3208 wishLv = wishLv * 150 / 100;
3212 wishLv = wishLv * 150 / 100;
3215 Debug.Log(power +
"/" + wishValue);
3216 string _s = s.ToLower();
3224 if (
item.giftRank >= 2 &&
item.IsValidArtifact(r.
id))
3251 string text = r.
GetName().ToLower();
3252 int score =
Compare(_s, text);
3265 if (category.IsChildOf(
"weapon") || category.IsChildOf(
"armor") || category.IsChildOf(
"ranged"))
3267 CardBlueprint.SetRarity(Rarity.Legendary);
3272 bool flag2 = thing.trait is
TraitDeed || thing.rarity >=
Rarity.Artifact || thing.
source._origin ==
"artifact_summon";
3276 thing.c_charges = 0;
3279 num = EClass.rndHalf(wishValue * 3);
3282 num = EClass.rndHalf(wishValue / 500 + 4);
3285 num = EClass.rndHalf(wishValue / 500 + 4);
3288 num = EClass.rndHalf(wishValue / 2000 + 4);
3291 if (!flag2 && thing.trait.CanStack)
3293 int num2 = wishValue;
3295 for (int i = 1; i < 1000; i++)
3297 int num3 = price + i * 2 * (price + 500);
3298 if (num3 > 0 && num2 > num3)
3307 if (price > 2500 && num > 3)
3309 num = 3 + (int)Mathf.Sqrt(num - 3);
3311 if (price > 5000 && num > 2)
3313 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
3315 if (price > 10000 && num > 1)
3317 num = 1 + Mathf.Min((
int)Mathf.Sqrt(num - 1) / 3, 2);
3324 Debug.Log(_s +
"/" + num +
"/" + score);
3325 if (thing.HasTag(
CTAG.godArtifact))
3339 if (list.Count == 0)
3341 netMsg = netMsg + Lang.space +
"wishFail".langGame();
3346 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3347 foreach (WishItem item2
in list)
3349 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)
void SetBool(string id, bool enable)
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)
void MakeAlly(bool msg=true)
void SetSummon(int duration, bool dropCorpse=false)
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)
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)