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);
181 if (CC.IsPCFactionOrMinion && (CC.HasElement(1651) ||
EClass.
pc.
Evalue(1651) >= 2))
188 if (
item.IsPCFactionOrMinion)
193 else if ((e.id != 910 && e.id != 911) || !
item.IsFood || !
item.category.IsChildOf(
"foodstuff"))
251 bool isChara = CC.isChara;
255 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
263 Dice dice =
Dice.
Create(text2, power, CC, (actref.refThing !=
null) ? null : actref.act);
269 Debug.Log(
id.ToString() +
"/" + text2 +
"/" + power +
"/" + actref.act?.ToString() +
"/" + dice?.
ToString() +
"/" + num4);
283 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
291 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
299 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as
Chara)) || (flag && c == CC))
303 if (isChara && points.Count > 1 && c !=
null && c.
isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.
Chara))
305 int num5 = CC.Evalue(302);
306 if (!CC.IsPC && CC.IsPCFactionOrMinion)
310 if (CC.HasElement(1214))
320 CC.ModExp(302, CC.IsPC ? 10 : 50);
324 num4 =
EClass.
rnd(num4 * 100 / (100 + num5 * 10 + 1));
327 CC.ModExp(302, CC.IsPC ? 20 : 100);
334 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) &&
EClass.
pc.
HasElement(1214))) &&
EClass.
rnd(5) != 0)
341 if (lang ==
"spell_hand")
343 string[] list2 =
Lang.
GetList(
"attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty(
"Touch") :
"Touch"));
344 string @ref =
"_elehand".lang(e.source.GetAltname(2), list2[4]);
345 CC.Say(c.
IsPCParty ?
"cast_hand_ally" :
"cast_hand", CC, c, @ref, c.
IsPCParty ? list2[1] : list2[2]);
349 CC.Say(lang +
"_hit", CC, c, e.
Name.ToLower());
352 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing !=
null) ?
EClass.
_map.
FindChara(actref.refThing.c_uidRefCard) :
null));
374 num4 = num4 * Act.powerMod / 100;
379 c.
DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
387 AddCon<ConGravity>(1, power);
388 AddCon<ConBlind>(4, power);
389 AddCon<ConDim>(5, power / 2);
390 AddCon<ConSupress>(3, power / 2);
391 if (actref.refThing !=
null && actref.refThing.id ==
"gun_gravity2")
393 AddCon<ConEntangle>(4, power / 3);
394 AddCon<ConSilence>(4, power / 3);
395 AddCon<ConWeakResEle>(4, power);
396 AddCon<ConNightmare>(4, power);
403 long num6 = num4 * num / 100;
404 Debug.Log(num4 +
" v:" + num6 +
" evalue:" + e.Value +
" power:" + power +
" elepMod:" + num);
410 CC.Chara.mana.Mod((
int)num6);
424 void AddCon<T>(
int rate,
int power) where T :
Condition
436 EffectId.Suicide => CC.LV / 3 + 40,
437 EffectId.Meteor => 50 + power / 20,
438 _ => (actref.refThing !=
null) ? actref.refThing.material.hardness : (30 + power / 20),
440 bool flag5 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (
id == EffectId.Explosive && actref.refThing ==
null)) && !(EClass._zone is
Zone_Vernis);
476 p.
ModFire(-20, extinguish:
true);
481 foreach (
Card item3
in list)
497 bool flag2 = isNeg || flag;
517 CC.
Say(
"spell_earthquake", CC, element.
Name.ToLower());
527 DamageEle(CC,
id, power, element, list, actRef,
"spell_earthquake");
536 if (list3.Count == 0)
540 CC.
Say(
"spell_ball", CC, element.
Name.ToLower());
550 DamageEle(CC,
id, power, element, list3, actRef,
"spell_ball");
558 List<Point> list6 =
new List<Point>();
559 list6.Add(tp.
Copy());
565 if (!
DamageEle(CC,
id, power, element, list6, actRef, (
id ==
EffectId.DrainBlood ||
id ==
EffectId.DrainMana) ?
"" : ((
id ==
EffectId.Sword) ?
"spell_sword" :
"spell_hand")))
567 CC.
Say(
"spell_hand_miss", CC, element.
Name.ToLower());
579 List<Point> list7 =
new List<Point>();
580 list7.Add(tp.
Copy());
581 CC.
Say((
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow", CC, element.
Name.ToLower());
587 DamageEle(CC,
id, power, element, list7, actRef, (
id ==
EffectId.MoonSpear) ?
"spell_spear" :
"spell_arrow");
592 string n = actRef.n1;
593 if (!(n ==
"special"))
601 if (!
item.pos.IsSunLit)
603 item.pos.PlayEffect(
"darkwomb3");
613 CC.
Say(
"summon_ally", CC);
623 CC.
Say(
"summon_ally_fail", CC);
626 string id3 = actRef.n1;
631 bool flag4 = actRef.n1 ==
"special";
638 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ?
EClass.
rnd(2) : 0);
645 case "special_force":
656 num3 = Mathf.Clamp(7 + CC.
LV / 100, 4, 20);
665 for (
int j = 0; j < num3; j++)
673 if (point ==
null || !point.
IsValid)
681 CardBlueprint.current.lv = num5;
685 CardBlueprint.current.idEle = text;
752 if (!(n ==
"shadow"))
763 num7 = (CC.IsPCFactionOrMinion ? (CC.LV / 2) : (CC.
LV / 3 * 2));
767 num6 = chara.LV * (100 + power / 10) / 100 + power / 30;
781 num6 = power / 10 + 1;
785 chara.
SetLv((
int)num6);
793 if (!(n ==
"shadow"))
795 if (n ==
"special_force")
802 chara.hp = chara.MaxHP / 2;
807 Chara chara2 = chara;
809 chara2.hostility = hostility2;
811 else if (!(chara.
id ==
"cocoon") && (!(actRef.n1 ==
"monster") || actRef.refThing ==
null))
823 CC.
Say(
"summon_ally_fail", CC);
832 CC.
Say(
"summon_ally_fail", CC);
835 CC.
Say(
"spell_funnel", CC, element.
Name.ToLower());
840 chara3.
SetLv(Mathf.Abs(power) / 15);
850 if (list2.Count == 0)
854 CC.
Say(
"spell_breathe", CC, element.
Name.ToLower());
864 DamageEle(CC,
id, power, element, list2, actRef,
"spell_breathe");
891 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))))));
892 if ((
id ==
EffectId.Explosive ||
id ==
EffectId.Rocket) && actRef.refThing !=
null)
894 radius2 = 2 + actRef.refThing.Evalue(666);
911 bool flag5 =
id == EffectId.Explosive ||
id == EffectId.Suicide ||
id ==
EffectId.Rocket;
913 if (list5.Count == 0)
917 cc.
Say((
id ==
EffectId.Suicide) ?
"abSuicide" :
"spell_ball", cc, element.
Name.ToLower());
923 tp.PlayEffect(
"flare");
927 cc.PlaySound((id == EffectId.Flare) ?
"spell_flare" :
"spell_ball");
934 DamageEle(actRef.origin ?? cc,
id, power, element, list5, actRef, (
id ==
EffectId.Suicide) ?
"suicide" :
"spell_ball");
944 if (list4.Count == 0)
948 CC.
Say(
"spell_bolt", CC, element.
Name.ToLower());
958 DamageEle(CC,
id, power, element, list4, actRef,
"spell_bolt");
968 CC.
Say(
"ab" +
id, CC);
972 int id2 = ((
id ==
EffectId.Puddle) ? 4 : ((
id ==
EffectId.Bubble) ? 5 : ((
id ==
EffectId.MistOfDarkness) ? 6 : 7)));
975 if (
id ==
EffectId.Bubble && CC.
id ==
"cancer")
980 for (
int i = 0; i < num; i++)
1005 List<Card> list8 = tp.
ListCards().ToList();
1007 if (list8.Contains(CC))
1010 list8.Insert(0, CC);
1013 foreach (
Card item3
in list8)
1015 if (tc ==
null || item3 == tc)
1017 Proc(
id, power, state, CC, item3, actRef);
1018 if (flag2 && item3.
isChara && item3 != CC)
1020 CC.DoHostileAction(item3);
1022 if (actRef.refThing ==
null || !(actRef.refThing.trait is
TraitRod))
1027 if ((uint)(effectId - 200) <= 4u)
1036 CC.SayNothingHappans();
1055 int orgPower = power;
1056 if (blessed || flag)
1064 Point randomPoint = CC.
pos.
GetRandomPoint(2, requireLos:
false, allowChara:
false, allowBlocked:
false, 200);
1067 CC.
Say(
"split_fail", CC);
1072 CC.
Say(
"split", CC);
1080 CC.
Say(
"escape", CC);
1086 if (CC.
id ==
"bell_silver")
1099 CC.
Say(
"burn_mana", CC);
1107 if (list3.Count == 0)
1115 item.PlayEffect(
"vanish");
1127 thing3.c_idRefCard =
"dog_mine";
1128 Zone.ignoreSpawnAnime =
true;
1132 case EffectId.LittleSisterMigration:
1135 bool flag3 =
id ==
EffectId.SilverCatMigration;
1141 List<Chara> list2 =
new List<Chara>();
1156 if (list2.Count == 0)
1162 foreach (
Chara item2
in list2)
1167 Msg.
Say(flag3 ?
"cat_migration" :
"little_migration", list2.Count.ToString() ??
"");
1171 EClass.player.stats.catDepart += list2.Count;
1175 EClass.player.stats.sistersDepart += list2.Count;
1187 CC.
Say(
"abMagicMap_curse", CC);
1193 CC.
Say(
"abMagicMap", CC);
1211 Dice dice =
Dice.
Create(
"ActManaAbsorb", power, CC, (actRef.refThing !=
null) ? null : actRef.act);
1212 TC.mana.Mod(dice.
Roll());
1213 TC.PlaySound(
"heal");
1214 TC.PlayEffect(
"heal");
1217 CC.
Say(
"absorbMana", CC);
1229 TC.PlaySound(
"curse3");
1230 TC.PlayEffect(
"curse");
1231 TC.Say(
"forgetItems",
TC);
1232 int num4 = power / 50 + 1 +
EClass.
rnd(3);
1233 List<Thing> source =
TC.things.List((
Thing t) => t.c_IDTState == 0);
1234 for (
int i = 0; i < num4; i++)
1236 source.RandomItem().c_IDTState = 5;
1245 bool armor =
id == EffectId.EnchantArmor ||
id ==
EffectId.EnchantArmorGreat;
1246 bool flag7 =
id == EffectId.EnchantWeaponGreat ||
id ==
EffectId.EnchantArmorGreat;
1256 cc.
Say(
"enc_curse", tc);
1260 int num5 = (flag7 ? 4 : 2) + (blessed ? 1 : 0);
1261 if (tc.
encLV >= num5)
1263 cc.
Say(
"enc_resist", tc);
1273 bool flag6 =
id ==
EffectId.GreaterIdentify;
1323 int num3 = (tc.isWeightChanged ? tc.c_weight : tc.
Thing.
source.weight);
1324 tc.isWeightChanged =
true;
1332 num3 = (int)(0.01f * (
float)num3 * (float)power * 0.75f + 500f);
1333 if (num3 < 0 || num3 > 10000000)
1351 cc.
Say(
"lighten_curse", tc);
1355 num3 = num3 * (100 - power / 10) / 100;
1373 cc.
Say(
"lighten", tc);
1397 cc.
Say(
"reconstruct", tc);
1398 EClass.game.cards.uidNext +=
EClass.
rnd(30);
1402 blesstedState = state
1405 thing4.genLv = num6;
1406 thing4.idSkin = tc.
idSkin;
1410 if (thing4.
id ==
"amulet_engagement" || thing4.
id ==
"ring_engagement")
1418 thing4.rarity =
Rarity.Mythical;
1423 CC.
Pick(thing4, msg:
false);
1430 case EffectId.ChangeMaterialLesser:
1432 case EffectId.ChangeMaterialGreater:
1444 string name2 = tc.
Name;
1447 bool num7 =
id ==
EffectId.ChangeMaterialGreater;
1448 bool flag8 =
id ==
EffectId.ChangeMaterialLesser;
1468 num8 = Mathf.Clamp(num8 +
EClass.
rnd(2), 0, 4);
1471 text2 = ((text2 ==
"metal") ?
"leather" :
"metal");
1474 for (
int j = 0; j < 1000; j++)
1485 if ((tc.
id ==
"log" || tc.
id ==
"branch") && tc.material.alias ==
"carbone")
1501 cc.
Say(
"materialChanged", name2, row.GetName());
1524 string name = tc.
Name;
1527 bool flag2 = tc.rarity ==
Rarity.Legendary;
1530 rarity = (flag2 ? Rarity.Mythical :
Rarity.Legendary),
1541 foreach (
Element item4
in thing.elements.dict.Values.ToList().Shuffle())
1551 if ((uint)(id2 - 64) > 3u)
1557 if (flag2 && num >= 2)
1563 tc.isCrafted =
false;
1564 tc.rarity = (flag2 ? Rarity.Mythical :
Rarity.Legendary);
1574 c2.
Say(
"reconstruct", c2);
1581 List<string> list12 =
new List<string>();
1582 for (
int num17 = 0; num17 < 10; num17++)
1584 list12.Add(AliasGen.GetRandomAlias());
1587 }, delegate(
int a,
string b)
1590 c2.
Say(
"reconstruct", c2);
1600 CC.
Say(
"reconstruct", CC);
1614 Dialog.
InputName(
"dialogVoidReturn".lang(max.ToString() ??
""), max.ToString() ??
"", delegate(
bool cancel,
string text)
1618 destLv = Mathf.Abs(text.ToInt());
1619 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1621 Debug.Log(destLv +
"/" + zone);
1627 Msg.
Say(
"returnComplete");
1628 EClass.player.uidLastTravelZone = 0;
1630 EClass.player.lastZonePos =
null;
1631 EClass.player.returnInfo =
null;
1658 Msg.
Say(
"returnNowhere");
1671 EClass.player.returnInfo =
null;
1721 Thing t3 =
ThingGen.
Create(
new string[6] {
"330",
"331",
"334",
"335",
"336",
"1142" }.RandomItem());
1727 List<Condition> list5 =
new List<Condition>();
1730 if (GetBlessingDifficulty(condition4) > 0 &&
EClass.
rnd(GetBlessingDifficulty(condition4)) == 0)
1732 list5.Add(condition4);
1735 if (list5.Count == 0)
1740 TC.pos.PlayEffect(
"holyveil");
1741 TC.pos.PlaySound(
"holyveil");
1742 TC.Say(
"unpolluted",
TC);
1775 TC.pos.PlayEffect(
"holyveil");
1776 TC.pos.PlaySound(
"holyveil");
1777 TC.pos.PlaySound(
"atk_eleSound");
1778 TC.conditions.ForeachReverse(delegate(
Condition c)
1785 TC.Say(
"abShutterHex",
TC);
1787 List<Chara> list4 =
TC.pos.ListCharasInRadius(
TC, 4, (
Chara c) => c ==
TC || c.IsHostile(CC));
1788 for (
int k = 0; k < num10; k++)
1790 TweenUtil.Delay((
float)k * 0.1f, delegate
1794 foreach (
Chara item6
in list4)
1799 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1801 componentInChildren.startColor = startColor;
1803 TweenUtil.Delay((
float)k * 0.1f, delegate
1805 effect.
Play(center, 0f, pos);
1807 int num11 =
Dice.
Create(
"SpShutterHex", power, CC, (actRef.refThing !=
null) ? null : actRef.act).Roll();
1816 if (CC.
Dist(
TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion &&
TC.isRestrained))
1825 if (point ==
null || !CC.
CanSeeLos(point))
1829 CC.
Say(
"abDraw", CC,
TC);
1837 if (CC.
id ==
"tentacle")
1846 if (nearbyCatToSniff !=
null)
1848 CC.
Sniff(nearbyCatToSniff);
1858 if (
TC.Evalue(426) > 0)
1860 TC.Say((actRef.n1 ==
"money") ?
"abStealNegateMoney" :
"abStealNegate",
TC);
1863 Thing thing7 =
null;
1864 bool flag12 = actRef.n1 ==
"food";
1865 if (actRef.n1 ==
"money")
1877 Func<Thing, bool> func = (
Thing t) =>
true;
1880 func = (
Thing t) => t.IsFood;
1882 List<Thing> list11 =
TC.things.List(delegate(
Thing t)
1888 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);
1889 }, onlyAccessible:
true);
1890 if (list11.Count > 0)
1892 thing7 = list11.RandomItem();
1895 thing7 = thing7.
Split(1);
1902 CC.
Say(
"abStealNothing", CC,
TC);
1907 CC.
Pick(thing7, msg:
false);
1909 if (actRef.n1 ==
"food")
1918 CC.
Say(
"abStealEscape", CC);
1919 CC.
Teleport(GetTeleportPos(tc.
pos, 30), silent:
true);
1928 if (CC !=
null && CC !=
TC)
1930 TC.Say(
"curse", CC,
TC);
1932 TC.PlaySound(
"curse3");
1933 TC.PlayEffect(
"curse");
1934 if (
EClass.
rnd(150 +
TC.LUC * 5 +
TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) ||
TC.TryNullifyCurse())
1938 List<Thing> list6 =
TC.things.List(delegate(
Thing t)
1946 if (list6.Count == 0)
1951 Thing thing5 = list6.RandomItem();
1952 TC.Say(
"curse_hit",
TC, thing5);
1960 TC.Say(
"uncurseEQ" + (blessed ?
"_bless" : (flag ?
"_curse" :
"")),
TC);
1961 TC.PlaySound(
"uncurse");
1962 TC.PlayEffect(
"uncurse");
1970 List<Thing> list =
new List<Thing>();
1971 TC.things.Foreach(delegate(
Thing t)
1976 if (t.blessedState == BlessedState.Cursed)
1978 num16 = EClass.rnd(200);
1982 num16 = EClass.rnd(1000);
1988 if (
id ==
EffectId.UncurseEQGreater)
1994 TC.Say(
"uncurseEQ_success", t);
2010 foreach (
Thing item7
in list)
2014 if (success == 0 && fail == 0)
2016 TC.SayNothingHappans();
2020 TC.Say(
"uncurseEQ_fail");
2026 string text3 = actRef.n1;
2031 if (!text4.IsEmpty())
2038 if (!actRef.aliasEle.IsEmpty())
2040 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
2043 condition2.isPerfume = TC.IsPC && actRef.
isPerfume;
2044 Condition condition3 =
TC.AddCondition(condition2);
2045 if (condition3 !=
null && condition3.
isPerfume)
2047 condition3.value = 3;
2050 if (!text4.IsEmpty())
2062 for (
int l = 0; l < 4 +
EClass.
rnd(2); l++)
2081 bool isPowerful =
TC.IsPowerful;
2082 string n = actRef.n1;
2083 if (n ==
"ConSuffocation")
2085 power = power * 2 / 3;
2088 int num12 = TC.WIL * (isPowerful ? 20 : 5);
2090 if (condition !=
null)
2092 num12 += condition.power * 5;
2096 TC.Say(
"debuff_resist",
TC);
2104 if (!actRef.aliasEle.IsEmpty())
2108 (con as
ConMiasma)?.SetResistPenetrationLevel(
TC, CC);
2122 TC.MutateRandom(1, 100, ether:
false, state);
2129 TC.MutateRandom(-1, 100, ether:
false, state);
2149 if (blessed || flag)
2153 Dialog.
InputName(
"dialogWish",
"q", delegate(
bool cancel,
string text)
2170 tc.
Say(
"faith_curse", tc,
faith.Name);
2175 tc.
Say(
"faith_bless", tc,
faith.Name);
2177 tc.
ModExp(306, power * 10);
2180 tc.
ModExp(85, power * 10);
2189 int gender2 = gender
switch
2203 if (blessed && age3 > 1)
2205 tc.
Say(
"ageDown", tc);
2210 tc.
Say(
"ageUp", tc);
2219 int num13 = ((actRef.refThing !=
null) ? actRef.refThing.GetInt(118) : actRef.refVal);
2225 num13 = EClass.game.seed + tc.
uid;
2229 tc.
Say(
"transBlood", tc);
2231 tc.c_bloodData =
null;
2240 if (!flag && age2 <= 0)
2245 age2 = Mathf.Max(0, age2 * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
2246 tc.
Say(flag ?
"ageUp" :
"ageDown", tc);
2264 tc.
Say(
"eternalYouth2", tc);
2278 tc.
Say(
"eternalYouth1", tc);
2279 tc.c_lockedAge = age + 1;
2291 Debug.Log(power +
"/" +
id.ToString() +
"/" + actRef.n1);
2302 else if (
id ==
EffectId.DebuffStats)
2307 if (power < 0 ||
id ==
EffectId.DebuffStats)
2309 power = Mathf.Abs(power);
2323 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();
2324 if (
TC.IsPCFaction ||
TC.IsPCFactionMinion)
2326 if (
TC.IsPC && list10.Count == 0)
2330 if (list10.Count > 0)
2332 list10.RandomItem().Value.Chara.GetRevived();
2336 TC.SayNothingHappans();
2345 bool flag11 =
id == EffectId.DamageBody ||
id ==
EffectId.DamageBodyGreat;
2346 bool mind2 =
id == EffectId.DamageMind ||
id ==
EffectId.DamageMindGreat;
2347 int num15 = ((
id == EffectId.DamageBody ||
id ==
EffectId.DamageMind) ? 1 : (4 +
EClass.
rnd(4)));
2356 TC.PlayEffect(
"debuff");
2357 TC.PlaySound(
"debuff");
2359 TC.Say(flag11 ?
"damageBody" :
"damageMind",
TC);
2360 for (
int m = 0; m < num15; m++)
2362 TC.DamageTempElements(power, flag11, mind2,
id !=
EffectId.Weaken);
2375 bool flag9 =
id == EffectId.EnhanceBody ||
id ==
EffectId.EnhanceBodyGreat;
2376 bool mind =
id == EffectId.EnhanceMind ||
id ==
EffectId.EnhanceMindGreat;
2381 TC.Say(flag9 ?
"enhanceBody" :
"enhanceMind",
TC);
2382 TC.PlayEffect(
"buff");
2383 TC.PlaySound(
"buff");
2384 TC.EnhanceTempElements(power, flag9, mind, onlyRenew:
true);
2390 bool flag10 =
id ==
EffectId.RestoreBody;
2396 TC.Say(flag10 ?
"restoreBody" :
"restoreMind",
TC);
2397 TC.PlaySound(
"heal");
2398 TC.PlayEffect(
"heal");
2408 TC.CureHost(
CureType.HealComplete, power, state);
2409 TC.Say(
"heal_heavy",
TC);
2418 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();
2419 if (actRef.refThing !=
null)
2421 num9 = num9 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2425 TC.DamageHP(num9 / 2, 919, power);
2428 TC.HealHPHost(num9, (actRef.refThing ==
null &&
id !=
EffectId.JureHeal) ? HealSource.Magic :
HealSource.Item);
2430 TC.Say((power >= 300) ?
"heal_heavy" :
"heal_light",
TC);
2436 TC.Say(
"heal_jure",
TC);
2450 IList<Condition> list9 =
TC.conditions.Copy();
2462 CC.
Say(
"removeHex",
TC, item8.
Name.ToLower());
2471 CC.
Say(
"removeHex_fail",
TC, item8.
Name.ToLower());
2485 TC.PlaySound(
"heal");
2486 TC.PlayEffect(
"heal");
2489 TC.Say(
"cureCorruption_curse",
TC);
2491 TC.ModCorruption(power);
2495 TC.Say(
"cureCorruption",
TC);
2496 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2507 chara.c_altName = TC.c_altName ??
TC.source.GetName(
TC);
2519 TC.Say(
"drinkRamune",
TC);
2523 TC.Say(
"drinkGood",
TC);
2529 TC.Say(
"drinkMilk",
TC);
2546 TC.Say(
"drinkWater_dirty",
TC);
2552 TC.Say(
"drinkWater_clear",
TC);
2558 TC.Say(
"drinkWater_dirty",
TC);
2566 if (
TC.HasElement(1211))
2568 TC.Say(
"drinkSaltWater_snail",
TC);
2569 int num14 = ((TC.hp > 10) ? (
TC.hp -
EClass.
rnd(10)) : 10000);
2574 TC.Say(
"drinkSaltWater",
TC);
2579 if (
TC.HasElement(1215))
2581 TC.Say(
"drunk_dwarf",
TC);
2737 if (list7.Count != 0)
2739 Thing thing6 = list7.RandomItem();
2740 TC.Say(
"acid_hit",
TC);
2743 TC.Say(
"acid_nullify", thing6);
2745 else if (thing6.
encLV > -5)
2747 TC.Say(
"acid_rust",
TC, thing6);
2759 TC.DamageHP(power / 5, actRef.idEle, power);
2770 TC.Say(
"drink_acid",
TC);
2771 TC.DamageHP(power / 5, 923, power);
2774 Msg.
Say(
"nothingHappens");
2782 TC.Say(
"love_curse_self",
TC);
2786 TC.Say(
"love_curse", CC,
TC);
2787 TC.ModAffinity(CC, -power / 4, show:
false);
2789 TC.ShowEmo(
Emo.angry);
2793 LoveMiracle(
TC, CC, power,
id, state);
2799 if (
TC.HasElement(1532))
2801 TC.SetMutation(1532);
2805 TC.SetMutation(1533, 1);
2812 if (
TC.HasElement(1533))
2814 TC.SetMutation(1533);
2818 TC.SetMutation(1532, 1);
2821 TC.PlayEffect(
"aura_heaven");
2822 TC.PlaySound(
"godbless");
2825 TC.Say(
"grow_hair_fail",
TC);
2828 TC.Say(
"grow_hair",
TC);
2845 if (!CC.IsHostile(
TC))
2865 Proc(_id, orgPower, _state, cc, tc, _ref1);
2871 tc.
Say(
"eat_poison", tc);
2873 if (power > 100000000)
2877 int num = (int)Mathf.Sqrt(power * 100);
2889 tc.
Say(
"love_ground", tc);
2893 tc.
Say(
"love_chara", c, tc);
2902 tc.
Say(
"item_drop", thing);
2906 Thing c2 = tc.
MakeMilk(effect:
true, 1, addToZone:
true, state);
2907 tc.
Say(
"item_drop", c2);
2911 Thing c3 = tc.
MakeEgg(effect:
true, 1, addToZone:
true, (idEffect ==
EffectId.LovePlus) ? 3 : 20, state);
2912 tc.
Say(
"item_drop", c3);
2926 tc.
Say(
"love_ground", tc);
2930 tc.
Say(
"love_chara", c, tc);
2939 for (
int i = 0; i < 10000; i++)
2955 string netMsg =
GameLang.
Parse(
"wish".langGame(), thirdPerson:
true, name, s);
2956 List<WishItem> list =
new List<WishItem>();
2957 int wishLv = 10 + power / 4;
2958 int wishValue = 5000 + power * 50;
2961 wishLv = wishLv * 150 / 100;
2965 wishLv = wishLv * 150 / 100;
2968 Debug.Log(power +
"/" + wishValue);
2969 string _s = s.ToLower();
2977 if (
item.giftRank >= 2 &&
item.IsValidArtifact(r.
id))
3004 string text = r.
GetName().ToLower();
3005 int score = Compare(_s, text);
3018 if (category.IsChildOf(
"weapon") || category.IsChildOf(
"armor") || category.IsChildOf(
"ranged"))
3020 CardBlueprint.SetRarity(Rarity.Legendary);
3025 bool flag2 = thing.trait is
TraitDeed || thing.rarity >=
Rarity.Artifact || thing.
source._origin ==
"artifact_summon";
3029 thing.c_charges = 0;
3032 num = EClass.rndHalf(wishValue * 3);
3035 num = EClass.rndHalf(wishValue / 500 + 4);
3038 num = EClass.rndHalf(wishValue / 500 + 4);
3041 num = EClass.rndHalf(wishValue / 2000 + 4);
3044 if (!flag2 && thing.trait.CanStack)
3046 int num2 = wishValue;
3048 for (int i = 1; i < 1000; i++)
3050 int num3 = price + i * 2 * (price + 500);
3051 if (num3 > 0 && num2 > num3)
3060 if (price > 2500 && num > 3)
3062 num = 3 + (int)Mathf.Sqrt(num - 3);
3064 if (price > 5000 && num > 2)
3066 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
3068 if (price > 10000 && num > 1)
3070 num = 1 + Mathf.Min((
int)Mathf.Sqrt(num - 1) / 3, 2);
3077 Debug.Log(_s +
"/" + num +
"/" + score);
3078 if (thing.HasTag(
CTAG.godArtifact))
3092 if (list.Count == 0)
3094 netMsg = netMsg + Lang.space +
"wishFail".langGame();
3099 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3100 foreach (WishItem item2
in list)
3102 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
int GetInt(int id, int? defaultInt=null)
void SetInt(int id, int value=0)
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)
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
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)
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
SourceMaterial.Row matObj
bool HasZoneStairs(bool includeLocked=true)
void UnqeuipIfTooHeavy(Thing t)
static Chara CreateFromElement(string idEle, int lv=-1, string idFilter="chara")
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
static Chara Create(string id, int lv=-1)
override bool IsAliveInCurrentZone
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
void Cuddle(Chara c, bool headpat=false)
void InstantEat(Thing t=null, bool sound=true)
Condition AddCondition(string id, int p=100, bool force=false)
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
Chara GetNearbyCatToSniff()
bool CanSeeLos(Card c, int dist=-1)
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)
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 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)
void TryShatter(Point pos, int ele, int power)
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 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 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)
ReligionTrickery Trickery
static Thing Reforge(string id, Point pos=null, bool first=true)
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 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)