public int GetCount(string s) { int[] dp = new dp[s.Length]; dp[s.Length] = 0; dp[s.Length - 1] = dp[s.Length - 2] = 1; for (int i = s.Length - 3; i >= 0; i--) { if (isChar) { dp[i] = dp[i + 1] + dp[i + 2]; } else { dp[i] = dp[i + 1]; } } return(dp[0]); }
public void a(dp A_0) { if (this.c["HealKits"].a(0, k.a(A_0.a)) == null) { v v = new v(this.c["HealKits"]); v.a("KitName", k.a(A_0.a)); v.a("RestoreBonus", k.a(A_0.b)); v.a("SkillBonus", k.a(A_0.c)); v.a("WhichVital", k.a((int)A_0.d)); this.c["HealKits"].c(v); try { this.c.c(Path.Combine(PluginCore.ci, "gameinfodb.ugd")); } catch { } } }
public ConsumableItemDescriptor(dp instance) : base(instance) { _internal = instance; }
private void a(int A_0, bool A_1) { WorldObject obj2 = PluginCore.cq.aw.get_WorldFilter().get_Item(A_0); cv cv = PluginCore.cq.p.d(A_0); if ((A_1 && dh.b(A_0)) && (obj2.get_HasIdData() && (cv != null))) { ObjectClass class2 = cv.c(); if (class2 != ObjectClass.Monster) { if (class2 != ObjectClass.HealingKit) { return; } } else { if (!this.b(obj2.get_Name())) { int num = obj2.Values(2, -1); int num2 = cv.a(dt.dz, -1); v v = new v(this.c["SpeciesMembers"]); v[0] = k.a(obj2.get_Name()); v[1] = k.a(num); v[2] = k.a(num2); this.c["SpeciesMembers"].c(v); try { this.c.c(Path.Combine(PluginCore.ci, "gameinfodb.ugd")); } catch { } if (this.c["SpeciesDamages"].a(0, k.a(num)) == null) { a5.a(eChatType.Warnings, "Warning: added monster \"" + obj2.get_Name() + "\" to DB but species \"" + ((FileService)PluginCore.cq.aw.get_FileService()).get_SpeciesTable().GetById(num).get_Name() + "\" has no auto damage definition."); } PluginCore.cq.d.c(); if (this.a == null) { return; } this.a(); } return; } if (this.a(obj2.get_Name()) == null) { dp dp = new dp { a = obj2.get_Name(), b = obj2.Values(100, 1.0), c = obj2.Values(90, 0) }; switch (obj2.Values(0x59, 0)) { case 2: dp.d = eRechargeVital_Single.Health; break; case 4: dp.d = eRechargeVital_Single.Stamina; break; case 6: dp.d = eRechargeVital_Single.Mana; break; default: dp.d = eRechargeVital_Single.Health; break; } this.a(dp); if (this.a != null) { this.a(); } } } }
public bool b(eRechargeVital_Single A_0) { if ((PluginCore.cq.ax.get_Actions().get_CombatMode() == 8) && !er.j("UseKitsInMagicMode")) { return(false); } if ((A_0 != eRechargeVital_Single.Stamina) && (PluginCore.cq.ax.get_Actions().get_Vital().get_Item(4) < 15)) { return(false); } TrainingType type = PluginCore.cq.aw.get_CharacterFilter().get_Skills().get_Item(0x15).get_Training(); if ((type != 3) && (type != 2)) { return(false); } fz a = fz.a; switch (A_0) { case eRechargeVital_Single.Stamina: a = fz.c; break; case eRechargeVital_Single.Mana: a = fz.e; break; } double num = ((double)er.i("MinimumHealKitSuccessChance")) / 100.0; int k = 0; int num3 = 0x7fffffff; double num4 = -2147483648.0; foreach (KeyValuePair <string, fz> pair in PluginCore.cq.l.h) { if (((fz)pair.Value) == a) { dp dp = PluginCore.cq.x.a(pair.Key); if (dp != null) { double b = 1.0; b = dp.b; if (dh.a(dp.c, A_0) >= num) { foreach (cv cv in PluginCore.cq.p.a(pair.Key)) { int num7 = cv.a(dt.aa, 0); if ((b > num4) || ((b == num4) && (num7 < num3))) { k = cv.k; num3 = num7; num4 = b; } } } } } } if (k == 0) { return(false); } if (er.j("GoToPeaceModeToUseKits") && (PluginCore.cq.ax.get_Actions().get_CombatMode() != 1)) { dh.a(1); return(true); } PluginCore.cq.ax.get_Actions().ApplyItem(k, PluginCore.cg); return(true); }