public TrueWeapon(LiveMonster lm, int level, Weapon wpn) { self = lm; avatar = wpn; Level = level; Life = wpn.Dura; }
public void AddWeapon(int weaponId, int lv) { if (!CanAddWeapon()) { return; } Weapon wpn = new Weapon(weaponId); wpn.UpgradeToLevel(lv); var tWeapon = new TrueWeapon(this, lv, wpn); AddWeapon(tWeapon); }
public void UseWeapon(LiveMonster lm, ActiveCard card) { if (!CheckUseCard(card)) { return; } try { Weapon wpn = new Weapon(card.CardId); wpn.UpgradeToLevel(card.Level); BattleManager.Instance.BattleInfo.GetPlayer(IsLeft).WeaponAdd++; var tWeapon = new TrueWeapon(lm, card.Level, wpn); lm.AddWeapon(tWeapon); } catch (Exception e) { NLog.Warn(e); BattleManager.Instance.FlowWordQueue.Add(new FlowWord("未知错误", lm.Position, 0, "Red", 26, 0, 0, 2, 15), false); return; } CardManager.DeleteCardAt(SelectId); }
private void ReinstallCardProducts() { int index = 1; foreach (var monsterConfig in ConfigData.MonsterDict.Values) { if (monsterConfig.IsSpecial > 0) continue; Monster mon = new Monster(monsterConfig.Id); int rate = GetSellRate(monsterConfig.Id); CardProductMarkTypes mark = CardProductMarkTypes.Null; if (monsterConfig.IsNew > 0) { rate = 100; mark = CardProductMarkTypes.New; } if (MathTool.GetRandom(100) < rate) { if (mark == 0) { mark = mon.GetSellMark(); } CardProducts.Add(new CardProduct(index++, mon.Id, (int)mark)); } } foreach (var weaponConfig in ConfigData.WeaponDict.Values) { if (weaponConfig.IsSpecial > 0) continue; Weapon wpn = new Weapon(weaponConfig.Id); int rate = GetSellRate(weaponConfig.Id); CardProductMarkTypes mark = CardProductMarkTypes.Null; if (weaponConfig.IsNew > 0) { rate = 100; mark = CardProductMarkTypes.New; } if (MathTool.GetRandom(100) < rate) { if (mark == 0) { mark = wpn.GetSellMark(); } CardProducts.Add(new CardProduct(index++, wpn.Id, (int)mark)); } } foreach (var spellConfig in ConfigData.SpellDict.Values) { if (spellConfig.IsSpecial > 0) continue; Spell spl = new Spell(spellConfig.Id); int rate = GetSellRate(spellConfig.Id); CardProductMarkTypes mark = CardProductMarkTypes.Null; if (spellConfig.IsNew > 0) { rate = 100; mark = CardProductMarkTypes.New; } if (MathTool.GetRandom(100) < rate) { if (mark == 0) { mark = spl.GetSellMark(); } CardProducts.Add(new CardProduct(index++, spl.Id, (int)mark)); } } }
public WeaponCard(Weapon weapon) { this.weapon = weapon; card = new DeckCard(weapon.Id, 1, 0); }