public static BattlerSerializable Create(string monsterId, int level = 1) { BattlerSerializable enemy = new BattlerSerializable(); enemy = BattlerLogic.Create(monsterId, level); enemy.battlerType = BattlerEnum.BattlerType.Enemy; return(enemy); }
public static BattlerSerializable Create(string monsterId, string name, int level = 1) { var actor = BattlerLogic.Create(monsterId, level); actor.battlerType = BattlerEnum.BattlerType.Actor; actor.needExp = CalcNeedExp(monsterId, level); actor.hasExp = 0; actor.name = name; ActorDataModel actorData = ActorDataModel.Instance; actorData.Add(actor); return(actor); }
/// <summary> /// 報酬付与 /// </summary> public static List <LootItemStruct> BattleResult() { List <LootItemStruct> loots = new List <LootItemStruct>(); int gold = 0; //モンスター固有アイテム抽選 EnemyDataModel.Instance.Data.ForEach(enemy => { loots.AddRange(LootLogic.MonsterLootChoice(enemy.monsterId)); //ゴールド計算 TODO gold += enemy.level * 10; }); //ダンジョン固有アイテム抽選 TODO 確率 loots.AddRange(LootLogic.DungeonLootChoice(0.1f)); //アイテム獲得処理 List <ItemStruct> items = new List <ItemStruct>(); loots.ForEach(loot => { var item = ItemLogic.CreateItemFromLoot(loot); items.Add(item); }); StockItemDataModel.GetInstance().AddItems(items); //ゴールド獲得処理 loots.Add(new LootItemStruct() { Amount = gold, ItemId = ItemConsts.GOLD }); StockItemDataModel.GetInstance().AddGold(gold); //レベルアップ処理 //TODO レベルアップの仕様検討 //一般戦闘の場合は+1 エリート敵の場合は+2 int levelUpAmount = 1; loots.Add(new LootItemStruct() { Amount = levelUpAmount, ItemId = ItemConsts.LEVEL }); BattlerLogic.LevelUp(levelUpAmount); return(loots); }