2using System.Collections.Generic;
38 if (points.Count == 0)
52 List<Card> list =
new List<Card>();
56 power = power * actref.refThing.material.hardness / 10;
58 string text =
id.ToString();
59 string text2 = (
EClass.
sources.
calc.map.ContainsKey(text) ? text : (
EClass.
sources.
calc.map.ContainsKey(
"Sp" + text) ? (
"Sp" + text) : (text.ToLowerInvariant() +
"_")));
60 foreach (
Point p
in points)
76 text2 =
"SpEarthquake";
84 if (CC.isChara && p.
Equals(CC.pos) && points.Count >= 2)
104 effect.sr.color = elementRef.colorSprite;
106 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
107 Color startColor = (componentInChildren.endColor = elementRef.colorSprite);
108 componentInChildren.startColor = startColor;
118 float num3 = 0.06f * (float)CC.pos.Distance(p);
120 TweenUtil.Tween(num3,
null, delegate
132 effect =
Effect.
Get(
"Element/ball_" + ((e.id == 0) ?
"Void" : ((
id ==
EffectId.GravityGun) ?
"Gravity" : e.source.alias.Remove(0, 3))));
135 effect =
Effect.
Get(
"Element/ball_Fire");
137 float startDelay = ((
id ==
EffectId.Meteor) ? 0.1f : 0.04f) * (float)CC.pos.Distance(p);
142 float duration = 0.06f * (float)CC.pos.Distance(p);
144 TweenUtil.Tween(duration,
null, delegate
162 effect.
Play(CC.pos, 0f, p);
169 effect.
Play(p).Flip(p.
x > CC.pos.x);
228 bool isChara = CC.isChara;
232 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
240 Dice dice =
Dice.
Create(text2, power, CC, (actref.refThing !=
null) ? null : actref.act);
246 Debug.Log(
id.ToString() +
"/" + text2 +
"/" + power +
"/" + actref.act?.ToString() +
"/" + dice?.
ToString() +
"/" + num4);
260 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
268 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
276 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as
Chara)) || (flag && c == CC))
280 if (isChara && points.Count > 1 && c !=
null && c.
isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.
Chara))
282 int num5 = CC.Evalue(302);
283 if (!CC.IsPC && CC.IsPCFactionOrMinion)
287 if (CC.HasElement(1214))
297 CC.ModExp(302, CC.IsPC ? 10 : 50);
301 num4 =
EClass.
rnd(num4 * 100 / (100 + num5 * 10 + 1));
304 CC.ModExp(302, CC.IsPC ? 20 : 100);
311 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) &&
EClass.
pc.
HasElement(1214))) &&
EClass.
rnd(5) != 0)
318 if (lang ==
"spell_hand")
320 string[] list2 =
Lang.
GetList(
"attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty(
"Touch") :
"Touch"));
321 string @ref =
"_elehand".lang(e.source.GetAltname(2), list2[4]);
322 CC.Say(c.
IsPCParty ?
"cast_hand_ally" :
"cast_hand", CC, c, @ref, c.
IsPCParty ? list2[1] : list2[2]);
326 CC.Say(lang +
"_hit", CC, c, e.
Name.ToLower());
329 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing !=
null) ?
EClass.
_map.
FindChara(actref.refThing.c_uidRefCard) :
null));
351 num4 = num4 * Act.powerMod / 100;
356 c.
DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
364 AddCon<ConGravity>(1, power);
365 AddCon<ConBlind>(4, power);
366 AddCon<ConDim>(5, power / 2);
367 AddCon<ConSupress>(3, power / 2);
368 if (actref.refThing !=
null && actref.refThing.id ==
"gun_gravity2")
370 AddCon<ConEntangle>(4, power / 3);
371 AddCon<ConSilence>(4, power / 3);
372 AddCon<ConWeakResEle>(4, power);
373 AddCon<ConNightmare>(4, power);
380 long num6 = num4 * num / 100;
381 Debug.Log(num4 +
" v:" + num6 +
" evalue:" + e.Value +
" power:" + power +
" elepMod:" + num);
387 CC.Chara.mana.Mod((
int)num6);
401 void AddCon<T>(
int rate,
int power) where T :
Condition
413 EffectId.Suicide => CC.LV / 3 + 40,
414 EffectId.Meteor => 50 + power / 20,
415 _ => (actref.refThing !=
null) ? actref.refThing.material.hardness : (30 + power / 20),
417 bool flag3 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (
id == EffectId.Explosive && actref.refThing ==
null)) && !(EClass._zone is
Zone_Vernis);
453 p.
ModFire(-20, extinguish:
true);
458 foreach (
Card item2
in list)
474 bool flag2 = isNeg || flag;
494 CC.
Say(
"spell_earthquake", CC, element.
Name.ToLower());
504 DamageEle(CC,
id, power, element, list, actRef,
"spell_earthquake");
513 if (list3.Count == 0)
517 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
527 DamageEle(CC,
id, power, element, list3, actRef,
"spell_ball");
535 List<Point> list6 =
new List<Point>();
536 list6.Add(tp.
Copy());
542 if (!
DamageEle(CC,
id, power, element, list6, actRef, (
id ==
EffectId.DrainBlood ||
id ==
EffectId.DrainMana) ?
"" : ((
id ==
EffectId.Sword) ?
"spell_sword" :
"spell_hand")))
544 CC.
Say(
"spell_hand_miss", CC, element.
Name.ToLower());
556 List<Point> list7 =
new List<Point>();
557 list7.Add(tp.
Copy());
558 CC.
Say((
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow", CC, element.
Name.ToLower());
564 DamageEle(CC,
id, power, element, list7, actRef, (
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow");
569 string n = actRef.n1;
570 if (!(n ==
"special"))
578 if (!
item.pos.IsSunLit)
580 item.pos.PlayEffect(
"darkwomb3");
590 CC.
Say(
"summon_ally", CC);
600 CC.
Say(
"summon_ally_fail", CC);
603 string id3 = actRef.n1;
608 bool flag4 = actRef.n1 ==
"special";
615 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ?
EClass.
rnd(2) : 0);
622 case "special_force":
633 num3 = Mathf.Clamp(7 + CC.
LV / 100, 4, 20);
642 for (
int j = 0; j < num3; j++)
650 if (point ==
null || !point.
IsValid)
658 CardBlueprint.current.lv = num5;
662 CardBlueprint.current.idEle = text;
729 if (!(n ==
"shadow"))
740 num7 = (CC.IsPCFactionOrMinion ? (CC.LV / 2) : (CC.
LV / 3 * 2));
744 num6 = chara.LV * (100 + power / 10) / 100 + power / 30;
758 num6 = power / 10 + 1;
762 chara.
SetLv((
int)num6);
770 if (!(n ==
"shadow"))
772 if (n ==
"special_force")
779 chara.hp = chara.MaxHP / 2;
784 Chara chara2 = chara;
786 chara2.hostility = hostility2;
788 else if (!(chara.
id ==
"cocoon") && (!(actRef.n1 ==
"monster") || actRef.refThing ==
null))
800 CC.
Say(
"summon_ally_fail", CC);
809 CC.
Say(
"summon_ally_fail", CC);
812 CC.
Say(
"spell_funnel", CC, element.
Name.ToLower());
817 chara3.
SetLv(Mathf.Abs(power) / 15);
827 if (list2.Count == 0)
831 CC.
Say(
"spell_breathe", CC, element.
Name.ToLower());
841 DamageEle(CC,
id, power, element, list2, actRef,
"spell_breathe");
868 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))))));
869 if ((
id ==
EffectId.Explosive ||
id ==
EffectId.Rocket) && actRef.refThing !=
null)
871 radius2 = 2 + actRef.refThing.Evalue(666);
888 bool flag5 =
id == EffectId.Explosive ||
id == EffectId.Suicide ||
id ==
EffectId.Rocket;
890 if (list5.Count == 0)
894 cc.
Say((
id ==
EffectId.Suicide) ?
"abSuicide" :
"spell_ball", cc, element.
Name.ToLower());
900 tp.PlayEffect(
"flare");
904 cc.PlaySound((id == EffectId.Flare) ?
"spell_flare" :
"spell_ball");
911 DamageEle(actRef.origin ?? cc,
id, power, element, list5, actRef, (
id ==
EffectId.Suicide) ?
"suicide" :
"spell_ball");
921 if (list4.Count == 0)
925 CC.
Say(
"spell_bolt", CC, element.
Name.ToLower());
935 DamageEle(CC,
id, power, element, list4, actRef,
"spell_bolt");
945 CC.
Say(
"ab" +
id, CC);
949 int id2 = ((
id ==
EffectId.Puddle) ? 4 : ((
id ==
EffectId.Bubble) ? 5 : ((
id ==
EffectId.MistOfDarkness) ? 6 : 7)));
952 if (
id ==
EffectId.Bubble && CC.
id ==
"cancer")
957 for (
int i = 0; i < num; i++)
982 List<Card> list8 = tp.
ListCards().ToList();
984 if (list8.Contains(CC))
990 foreach (
Card item3
in list8)
992 if (tc ==
null || item3 == tc)
994 Proc(
id, power, state, CC, item3, actRef);
995 if (flag2 && item3.
isChara && item3 != CC)
997 CC.DoHostileAction(item3);
999 if (actRef.refThing ==
null || !(actRef.refThing.trait is
TraitRod))
1004 if ((uint)(effectId - 200) <= 4u)
1013 CC.SayNothingHappans();
1032 int orgPower = power;
1033 if (blessed || flag)
1050 CC.
Say(
"escape", CC);
1056 if (CC.
id ==
"bell_silver")
1069 CC.
Say(
"burn_mana", CC);
1077 if (list2.Count == 0)
1085 item.PlayEffect(
"vanish");
1097 thing3.c_idRefCard =
"dog_mine";
1098 Zone.ignoreSpawnAnime =
true;
1102 case EffectId.LittleSisterMigration:
1105 bool flag7 =
id ==
EffectId.SilverCatMigration;
1111 List<Chara> list3 =
new List<Chara>();
1126 if (list3.Count == 0)
1132 foreach (
Chara item2
in list3)
1137 Msg.
Say(flag7 ?
"cat_migration" :
"little_migration", list3.Count.ToString() ??
"");
1141 EClass.player.stats.catDepart += list3.Count;
1144 EClass.player.stats.sistersDepart += list3.Count;
1156 CC.
Say(
"abMagicMap_curse", CC);
1162 CC.
Say(
"abMagicMap", CC);
1180 Dice dice =
Dice.
Create(
"ActManaAbsorb", power, CC, (actRef.refThing !=
null) ? null : actRef.act);
1181 TC.mana.Mod(dice.
Roll() + TC.mana.max / 5);
1182 TC.PlaySound(
"heal");
1183 TC.PlayEffect(
"heal");
1186 CC.
Say(
"absorbMana", CC);
1198 TC.PlaySound(
"curse3");
1199 TC.PlayEffect(
"curse");
1200 TC.Say(
"forgetItems",
TC);
1201 int num = power / 50 + 1 +
EClass.
rnd(3);
1202 List<Thing> source =
TC.things.List((
Thing t) => t.c_IDTState == 0);
1203 for (
int i = 0; i < num; i++)
1205 source.RandomItem().c_IDTState = 5;
1214 bool armor =
id == EffectId.EnchantArmor ||
id ==
EffectId.EnchantArmorGreat;
1215 bool flag2 =
id == EffectId.EnchantWeaponGreat ||
id ==
EffectId.EnchantArmorGreat;
1225 cc.
Say(
"enc_curse", tc);
1229 int num2 = (flag2 ? 4 : 2) + (blessed ? 1 : 0);
1230 if (tc.
encLV >= num2)
1232 cc.
Say(
"enc_resist", tc);
1242 bool flag3 =
id ==
EffectId.GreaterIdentify;
1292 int num4 = (tc.isWeightChanged ? tc.c_weight : tc.
Thing.
source.weight);
1293 tc.isWeightChanged =
true;
1301 num4 = (int)(0.01f * (
float)num4 * (float)power * 0.75f + 500f);
1302 if (num4 < 0 || num4 > 10000000)
1320 cc.
Say(
"lighten_curse", tc);
1324 num4 = num4 * (100 - power / 10) / 100;
1342 cc.
Say(
"lighten", tc);
1366 cc.
Say(
"reconstruct", tc);
1367 EClass.game.cards.uidNext +=
EClass.
rnd(30);
1371 blesstedState = state
1375 thing.idSkin = tc.
idSkin;
1379 if (thing.
id ==
"amulet_engagement" || thing.
id ==
"ring_engagement")
1387 thing.rarity =
Rarity.Mythical;
1392 CC.
Pick(thing, msg:
false);
1399 case EffectId.ChangeMaterialLesser:
1401 case EffectId.ChangeMaterialGreater:
1413 string name2 = tc.
Name;
1416 bool num7 =
id ==
EffectId.ChangeMaterialGreater;
1417 bool flag6 =
id ==
EffectId.ChangeMaterialLesser;
1437 num8 = Mathf.Clamp(num8 +
EClass.
rnd(2), 0, 4);
1440 text2 = ((text2 ==
"metal") ?
"leather" :
"metal");
1443 for (
int j = 0; j < 1000; j++)
1454 if ((tc.
id ==
"log" || tc.
id ==
"branch") && tc.material.alias ==
"carbone")
1470 cc.
Say(
"materialChanged", name2, row.GetName());
1493 string name = tc.
Name;
1496 bool flag5 = tc.rarity ==
Rarity.Legendary;
1499 rarity = (flag5 ? Rarity.Mythical :
Rarity.Legendary),
1510 foreach (
Element item4
in thing2.elements.dict.Values.ToList().Shuffle())
1520 if ((uint)(id2 - 64) > 3u)
1526 if (flag5 && num5 >= 2)
1532 tc.isCrafted =
false;
1533 tc.rarity = (flag5 ? Rarity.Mythical :
Rarity.Legendary);
1543 c2.
Say(
"reconstruct", c2);
1550 List<string> list12 =
new List<string>();
1551 for (
int num19 = 0; num19 < 10; num19++)
1553 list12.Add(AliasGen.GetRandomAlias());
1556 }, delegate(
int a,
string b)
1559 c2.
Say(
"reconstruct", c2);
1569 CC.
Say(
"reconstruct", CC);
1583 Dialog.
InputName(
"dialogVoidReturn".lang(max.ToString() ??
""), max.ToString() ??
"", delegate(
bool cancel,
string text)
1587 destLv = Mathf.Abs(text.ToInt());
1588 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1590 Debug.Log(destLv +
"/" + zone);
1596 Msg.
Say(
"returnComplete");
1597 EClass.player.uidLastTravelZone = 0;
1599 EClass.player.lastZonePos =
null;
1600 EClass.player.returnInfo =
null;
1627 Msg.
Say(
"returnNowhere");
1640 EClass.player.returnInfo =
null;
1690 Thing t2 =
ThingGen.
Create(
new string[6] {
"330",
"331",
"334",
"335",
"336",
"1142" }.RandomItem());
1696 List<Condition> list11 =
new List<Condition>();
1699 if (GetBlessingDifficulty(condition4) > 0 &&
EClass.
rnd(GetBlessingDifficulty(condition4)) == 0)
1701 list11.Add(condition4);
1704 if (list11.Count == 0)
1709 TC.pos.PlayEffect(
"holyveil");
1710 TC.pos.PlaySound(
"holyveil");
1711 TC.Say(
"unpolluted",
TC);
1744 TC.pos.PlayEffect(
"holyveil");
1745 TC.pos.PlaySound(
"holyveil");
1746 TC.pos.PlaySound(
"atk_eleSound");
1747 TC.conditions.ForeachReverse(delegate(
Condition c)
1754 TC.Say(
"abShutterHex",
TC);
1756 List<Chara> list5 =
TC.pos.ListCharasInRadius(
TC, 4, (
Chara c) => c ==
TC || c.IsHostile(CC));
1757 for (
int l = 0; l < num14; l++)
1759 TweenUtil.Delay((
float)l * 0.1f, delegate
1763 foreach (
Chara item6
in list5)
1768 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1770 componentInChildren.startColor = startColor;
1772 TweenUtil.Delay((
float)l * 0.1f, delegate
1774 effect.
Play(center, 0f, pos);
1776 int num15 =
Dice.
Create(
"SpShutterHex", power, CC, (actRef.refThing !=
null) ? null : actRef.act).Roll();
1785 if (CC.
Dist(
TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion &&
TC.isRestrained))
1794 if (point ==
null || !CC.
CanSeeLos(point))
1798 CC.
Say(
"abDraw", CC,
TC);
1806 if (CC.
id ==
"tentacle")
1815 if (nearbyCatToSniff !=
null)
1817 CC.
Sniff(nearbyCatToSniff);
1827 if (
TC.Evalue(426) > 0)
1829 TC.Say((actRef.n1 ==
"money") ?
"abStealNegateMoney" :
"abStealNegate",
TC);
1832 Thing thing7 =
null;
1833 bool flag10 = actRef.n1 ==
"food";
1834 if (actRef.n1 ==
"money")
1846 Func<Thing, bool> func = (
Thing t) =>
true;
1849 func = (
Thing t) => t.IsFood;
1851 List<Thing> list8 =
TC.things.List(delegate(
Thing t)
1857 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);
1858 }, onlyAccessible:
true);
1859 if (list8.Count > 0)
1861 thing7 = list8.RandomItem();
1864 thing7 = thing7.
Split(1);
1871 CC.
Say(
"abStealNothing", CC,
TC);
1876 CC.
Pick(thing7, msg:
false);
1878 if (actRef.n1 ==
"food")
1887 CC.
Say(
"abStealEscape", CC);
1888 CC.
Teleport(GetTeleportPos(tc.
pos, 30), silent:
true);
1897 if (CC !=
null && CC !=
TC)
1899 TC.Say(
"curse", CC,
TC);
1901 TC.PlaySound(
"curse3");
1902 TC.PlayEffect(
"curse");
1903 if (
EClass.
rnd(150 +
TC.LUC * 5 +
TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) ||
TC.TryNullifyCurse())
1907 List<Thing> list6 =
TC.things.List(delegate(
Thing t)
1915 if (list6.Count == 0)
1920 Thing thing5 = list6.RandomItem();
1921 TC.Say(
"curse_hit",
TC, thing5);
1929 TC.Say(
"uncurseEQ" + (blessed ?
"_bless" : (flag ?
"_curse" :
"")),
TC);
1930 TC.PlaySound(
"uncurse");
1931 TC.PlayEffect(
"uncurse");
1939 List<Thing> list =
new List<Thing>();
1940 TC.things.Foreach(delegate(
Thing t)
1945 if (t.blessedState == BlessedState.Cursed)
1947 num18 = EClass.rnd(200);
1951 num18 = EClass.rnd(1000);
1957 if (
id ==
EffectId.UncurseEQGreater)
1963 TC.Say(
"uncurseEQ_success", t);
1979 foreach (
Thing item7
in list)
1983 if (success == 0 && fail == 0)
1985 TC.SayNothingHappans();
1989 TC.Say(
"uncurseEQ_fail");
1995 string text3 = actRef.n1;
2000 if (!text4.IsEmpty())
2007 if (!actRef.aliasEle.IsEmpty())
2009 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
2012 condition2.isPerfume = TC.IsPC && actRef.
isPerfume;
2013 Condition condition3 =
TC.AddCondition(condition2);
2014 if (condition3 !=
null && condition3.
isPerfume)
2016 condition3.value = 3;
2019 if (!text4.IsEmpty())
2031 for (
int k = 0; k < 4 +
EClass.
rnd(2); k++)
2050 bool isPowerful =
TC.IsPowerful;
2051 string n = actRef.n1;
2052 if (n ==
"ConSuffocation")
2054 power = power * 2 / 3;
2056 int num10 = TC.WIL * (isPowerful ? 20 : 5);
2058 if (condition !=
null)
2060 num10 += condition.power * 5;
2066 int num12 = (TC.IsPowerful ? 40 : 90);
2075 if (condition !=
null)
2085 TC.Say(
"debuff_resist",
TC);
2094 if (!actRef.aliasEle.IsEmpty())
2098 (con as
ConMiasma)?.SetResistPenetrationLevel(
TC, CC);
2112 TC.MutateRandom(1, 100, ether:
false, state);
2119 TC.MutateRandom(-1, 100, ether:
false, state);
2139 if (blessed || flag)
2143 Dialog.
InputName(
"dialogWish",
"q", delegate(
bool cancel,
string text)
2160 tc.
Say(
"faith_curse", tc,
faith.Name);
2165 tc.
Say(
"faith_bless", tc,
faith.Name);
2167 tc.
ModExp(306, power * 10);
2170 tc.
ModExp(85, power * 10);
2179 int gender2 = gender
switch
2193 if (blessed && age3 > 1)
2195 tc.
Say(
"ageDown", tc);
2200 tc.
Say(
"ageUp", tc);
2209 int num13 = ((actRef.refThing !=
null) ? actRef.refThing.GetInt(118) : actRef.refVal);
2215 num13 = EClass.game.seed + tc.
uid;
2219 tc.
Say(
"transBlood", tc);
2221 tc.c_bloodData =
null;
2230 if (!flag && age <= 0)
2235 age = Mathf.Max(0, age * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
2236 tc.
Say(flag ?
"ageUp" :
"ageDown", tc);
2254 tc.
Say(
"eternalYouth2", tc);
2268 tc.
Say(
"eternalYouth1", tc);
2269 tc.c_lockedAge = age2 + 1;
2281 Debug.Log(power +
"/" +
id.ToString() +
"/" + actRef.n1);
2292 else if (
id ==
EffectId.DebuffStats)
2297 if (power < 0 ||
id ==
EffectId.DebuffStats)
2299 power = Mathf.Abs(power);
2313 List<KeyValuePair<int, Chara>> list10 =
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();
2314 if (
TC.IsPCFaction ||
TC.IsPCFactionMinion)
2316 if (
TC.IsPC && list10.Count == 0)
2320 if (list10.Count > 0)
2322 list10.RandomItem().Value.Chara.GetRevived();
2326 TC.SayNothingHappans();
2335 bool flag12 =
id == EffectId.DamageBody ||
id ==
EffectId.DamageBodyGreat;
2336 bool mind2 =
id == EffectId.DamageMind ||
id ==
EffectId.DamageMindGreat;
2337 int num17 = ((
id == EffectId.DamageBody ||
id ==
EffectId.DamageMind) ? 1 : (4 +
EClass.
rnd(4)));
2346 TC.PlayEffect(
"debuff");
2347 TC.PlaySound(
"debuff");
2349 TC.Say(flag12 ?
"damageBody" :
"damageMind",
TC);
2350 for (
int m = 0; m < num17; m++)
2352 TC.DamageTempElements(power, flag12, mind2,
id !=
EffectId.Weaken);
2365 bool flag9 =
id == EffectId.EnhanceBody ||
id ==
EffectId.EnhanceBodyGreat;
2366 bool mind =
id == EffectId.EnhanceMind ||
id ==
EffectId.EnhanceMindGreat;
2371 TC.Say(flag9 ?
"enhanceBody" :
"enhanceMind",
TC);
2372 TC.PlayEffect(
"buff");
2373 TC.PlaySound(
"buff");
2374 TC.EnhanceTempElements(power, flag9, mind, onlyRenew:
true);
2380 bool flag11 =
id ==
EffectId.RestoreBody;
2386 TC.Say(flag11 ?
"restoreBody" :
"restoreMind",
TC);
2387 TC.PlaySound(
"heal");
2388 TC.PlayEffect(
"heal");
2398 TC.CureHost(
CureType.HealComplete, power, state);
2399 TC.Say(
"heal_heavy",
TC);
2404 int num9 =
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();
2405 if (actRef.refThing !=
null)
2407 num9 = num9 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2411 TC.DamageHP(num9 / 2, 919, power);
2417 num9 += TC.MaxHP / 4;
2420 TC.HealHPHost(num9, (actRef.refThing ==
null &&
id !=
EffectId.JureHeal) ? HealSource.Magic :
HealSource.Item);
2422 TC.Say((power >= 300) ?
"heal_heavy" :
"heal_light",
TC);
2428 TC.Say(
"heal_jure",
TC);
2442 IList<Condition> list9 =
TC.conditions.Copy();
2454 CC.
Say(
"removeHex",
TC, item8.
Name.ToLower());
2463 CC.
Say(
"removeHex_fail",
TC, item8.
Name.ToLower());
2477 TC.PlaySound(
"heal");
2478 TC.PlayEffect(
"heal");
2481 TC.Say(
"cureCorruption_curse",
TC);
2483 TC.ModCorruption(power);
2487 TC.Say(
"cureCorruption",
TC);
2488 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2499 chara.c_altName = TC.c_altName ??
TC.source.GetName(
TC);
2511 TC.Say(
"drinkRamune",
TC);
2515 TC.Say(
"drinkGood",
TC);
2521 TC.Say(
"drinkMilk",
TC);
2538 TC.Say(
"drinkWater_dirty",
TC);
2544 TC.Say(
"drinkWater_clear",
TC);
2550 TC.Say(
"drinkWater_dirty",
TC);
2558 if (
TC.HasElement(1211))
2560 TC.Say(
"drinkSaltWater_snail",
TC);
2561 int num16 = ((TC.hp > 10) ? (
TC.hp -
EClass.
rnd(10)) : 10000);
2566 TC.Say(
"drinkSaltWater",
TC);
2571 if (
TC.HasElement(1215))
2573 TC.Say(
"drunk_dwarf",
TC);
2729 if (list7.Count != 0)
2731 Thing thing6 = list7.RandomItem();
2732 TC.Say(
"acid_hit",
TC);
2735 TC.Say(
"acid_nullify", thing6);
2737 else if (thing6.
encLV > -5)
2739 TC.Say(
"acid_rust",
TC, thing6);
2751 TC.DamageHP(power / 5, actRef.idEle, power);
2762 TC.Say(
"drink_acid",
TC);
2763 TC.DamageHP(power / 5, 923, power);
2766 Msg.
Say(
"nothingHappens");
2774 TC.Say(
"love_curse_self",
TC);
2778 TC.Say(
"love_curse", CC,
TC);
2779 TC.ModAffinity(CC, -power / 4, show:
false);
2781 TC.ShowEmo(
Emo.angry);
2785 LoveMiracle(
TC, CC, power,
id, state);
2791 if (
TC.HasElement(1532))
2793 TC.SetMutation(1532);
2797 TC.SetMutation(1533, 1);
2804 if (
TC.HasElement(1533))
2806 TC.SetMutation(1533);
2810 TC.SetMutation(1532, 1);
2813 TC.PlayEffect(
"aura_heaven");
2814 TC.PlaySound(
"godbless");
2817 TC.Say(
"grow_hair_fail",
TC);
2820 TC.Say(
"grow_hair",
TC);
2837 if (!CC.IsHostile(
TC))
2857 Proc(_id, orgPower, _state, cc, tc, _ref1);
2863 tc.
Say(
"eat_poison", tc);
2865 if (power > 100000000)
2869 int num = (int)Mathf.Sqrt(power * 100);
2881 tc.
Say(
"love_ground", tc);
2885 tc.
Say(
"love_chara", c, tc);
2894 tc.
Say(
"item_drop", thing);
2898 Thing c2 = tc.
MakeMilk(effect:
true, 1, addToZone:
true, state);
2899 tc.
Say(
"item_drop", c2);
2903 Thing c3 = tc.
MakeEgg(effect:
true, 1, addToZone:
true, (idEffect ==
EffectId.LovePlus) ? 3 : 20, state);
2904 tc.
Say(
"item_drop", c3);
2918 tc.
Say(
"love_ground", tc);
2922 tc.
Say(
"love_chara", c, tc);
2931 for (
int i = 0; i < 10000; i++)
2947 string netMsg =
GameLang.
Parse(
"wish".langGame(), thirdPerson:
true, name, s);
2948 List<WishItem> list =
new List<WishItem>();
2949 long wishLv = 10 + power / 4;
2953 wishLv = wishLv * 150 / 100;
2957 wishLv = wishLv * 150 / 100;
2960 Debug.Log(power +
"/" + wishValue);
2961 string _s = s.ToLower();
2969 if (
item.giftRank >= 2 &&
item.IsValidArtifact(r.
id))
2996 string text = r.
GetName().ToLower();
2997 int score =
Compare(_s, text);
3010 if (category.IsChildOf(
"weapon") || category.IsChildOf(
"armor") || category.IsChildOf(
"ranged"))
3012 CardBlueprint.SetRarity(Rarity.Legendary);
3017 bool flag2 = thing.trait is
TraitDeed || thing.rarity >=
Rarity.Artifact || thing.
source._origin ==
"artifact_summon";
3021 thing.c_charges = 0;
3024 num = EClass.rndHalf(wishValue * 3);
3027 num = EClass.rndHalf(wishValue / 500 + 4);
3030 num = EClass.rndHalf(wishValue / 500 + 4);
3033 num = EClass.rndHalf(wishValue / 2000 + 4);
3036 if (!flag2 && thing.trait.CanStack)
3038 int num2 = wishValue;
3040 for (int i = 1; i < 1000; i++)
3042 int num3 = price + i * 2 * (price + 500);
3043 if (num3 > 0 && num2 > num3)
3052 if (price > 2500 && num > 3)
3054 num = 3 + (int)Mathf.Sqrt(num - 3);
3056 if (price > 5000 && num > 2)
3058 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
3060 if (price > 10000 && num > 1)
3062 num = 1 + Mathf.Min((
int)Mathf.Sqrt(num - 1) / 3, 2);
3069 Debug.Log(_s +
"/" + num +
"/" + score);
3070 if (thing.HasTag(
CTAG.godArtifact))
3084 if (list.Count == 0)
3086 netMsg = netMsg + Lang.space +
"wishFail".langGame();
3091 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3092 foreach (WishItem item2
in list)
3094 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 DamageEle(Card CC, EffectId id, int power, Element e, List< Point > points, ActRef actref, string lang=null)
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 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
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
Chara TryDuplicate(DuplicateCondition con=DuplicateCondition.Default, Point dest=null)
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)
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 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)
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)