public void Init() { sm.InfoLoad(); for (int i = 0; i < 3; i++) { if (sm.Saves[i] != null && m_LoadText[i] != null) { m_LoadText[i].text = sm.Saves[i].Time.ToString(); } else if (m_LoadText[i] != null) { m_LoadText[i].text = ""; } } m_TaskNum = 0; //当前任务ID player_position = new Vector3(0, 0, 0); //记录场景移动时下一次移动的坐标,z坐标一般为0 //三个人物 //p1 = new Person(0, "小黑", 1000, 9999, 20, 30, 11, 18, 8, 1, 0, 3, 2, 2, 3, 4, 1, 1, "myimport/zhujue1/女主行走图", 2, 0, 0); //p2 = new Person(1, "小绿", 1000, 9999, 20, 30, 12, 18, 8, 1, 0, 3, 2, 2, 3, 4, 1, 1, "myimport/Npc/038-Mage06", 2, 0, 0); //p3 = new Person(2, "小蓝", 1000, 9999, 20, 30, 51, 18, 8, 1, 0, 3, 2, 2, 3, 4, 1, 1, "myimport/Npc/001-Fighter01", 2, 0, 0); p1 = new Person(0, "克萝莉亚", 590, 570, 50, 48, 73, 10, 10, 1, 0, 53, 14, 15, 7, 3, 2, 49, "myimport/zhujue1/女主行走图", 2, 0, 0); p2 = new Person(1, "西露达", 422, 606, 35, 71, 46, 8, 12, 1, 0, 47, 20, 11, 5, 2, 3, 56, "myimport/Npc/038-Mage06", 2, 0, 0); p3 = new Person(2, "帕吉尔", 710, 535, 67, 40, 58, 12, 8, 1, 0, 69, 9, 18, 6, 3, 2, 49, "myimport/Npc/001-Fighter01", 2, 0, 0); //背包,包括装备,物品,金钱 bag = new BackPack(); tk = new TalkText(); tl = new TaskList(); tk = new TalkText(); p1.AddSkill(p1.skillFactory.CreateSkill("无限剑制")); p1.AddSkill(p1.skillFactory.CreateSkill("六脉神剑")); p1.AddSkill(p1.skillFactory.CreateSkill("八荒六合")); p2.AddSkill(p2.skillFactory.CreateSkill("大火球")); p2.AddSkill(p2.skillFactory.CreateSkill("岩浆爆破")); p2.AddSkill(p2.skillFactory.CreateSkill("烈焰风暴")); p3.AddSkill(p3.skillFactory.CreateSkill("瞬劈")); p3.AddSkill(p3.skillFactory.CreateSkill("生死不觉")); p3.AddSkill(p3.skillFactory.CreateSkill("临危不惧")); bag.Money = 500; ProductFactory pf = new ProductFactory(); bag.SetGoods(pf.CreateProduct("血气丸", 3)); bag.SetGoods(pf.CreateProduct("凝神露", 3)); EquipmentFactory ef = new EquipmentFactory(); bag.SetGoods(ef.CreateEquipment("铁盔")); bag.SetGoods(ef.CreateEquipment("大法师之帽")); }
public BattleForm(IPokemonParty <IPokemon> pokemonParty, IPokemonParty <IPokemon> enemyPokemonParty) { InitializeComponent(); attackButtons[0] = btnAttack1; attackButtons[1] = btnAttack2; attackButtons[2] = btnAttack3; attackButtons[3] = btnAttack4; _battleLogController = new BattleLogController(this); _playerParty = pokemonParty; _enemyParty = enemyPokemonParty; _equipment = EquipmentFactory.CreateEquipment(); }
virtual public void InitEquitments(RobotCreatInfo info) { // Debug.Log("init Equipment"); //TODO: make the position selection not in an unchangeable function //the positions are now defined in the function EquipmentFactory.EquipmentCreatePosition[] posList = { EquipmentFactory.EquipmentCreatePosition.Up, EquipmentFactory.EquipmentCreatePosition.LeftRight, EquipmentFactory.EquipmentCreatePosition.Down, }; for (int i = 0; i < info.equipments.Length && i < posList.Length; ++i) { string equipmentName = info.equipments[i].ToString(); EquipmentFactory.EquipmentCreatePosition pos = posList[i]; equipmentList.Add(EquipmentFactory.CreateEquipment(equipmentName, this, pos)); } }
public void CreateItem() { _factory.Initialize(SelectedItemBase, Category); Equipment = _factory.CreateEquipment(); Status = new ItemStatus(); }
private void Run(CancellationToken ct) { var scourCost = _currencyFactory.Currency.First(x => x.Name == CurrencyNames.ScouringOrb).Value; for (var progress = 0d; progress < 100; progress = _craftingTree.GetCurrencySpent(ScourCount, BaseItemCount, BaseItemCost) / Currency * 100) { if (ct.IsCancellationRequested) { ct.ThrowIfCancellationRequested(); } var newItem = _equipmentFactory.CreateEquipment(); var result = _craftingTree.Craft(newItem, ct); EquipmentList.Add(result); if (!result.Corrupted && result.Rarity == EquipmentRarity.Normal) { continue; } bool added = false; ConditionResolver resolver = new ConditionResolver(); foreach (var prototype in _itemPrototypes) { if (resolver.IsValid(prototype.Condition, result)) { MatchingItems[prototype].Add(result); added = true; BaseItemCount++; break; } } if (!added) { if (!result.Corrupted && result.Rarity != EquipmentRarity.Normal && scourCost < BaseItemCost) { ScourCount++; } else { BaseItemCount++; } } Progress = progress; OnPropertyChanged(nameof(Progress)); } Progress = 100; IsCrafting = false; OnPropertyChanged(nameof(Progress)); App.Current.Dispatcher.Invoke((Action) delegate { OnCompletion?.Invoke(); }); }