コード例 #1
0
        public static void AddUnit(int id, int index)
        {
            RemoveUnit(Faction.Enemy, index);
            BattleUnitModel battleUnitModel = Singleton <StageController> .Instance.AddNewUnit(Faction.Enemy, id, index);

            UpdateUI();
            battleUnitModel.OnRoundStartOnlyUI();
            battleUnitModel.RollSpeedDice();
        }
コード例 #2
0
        public static void Revive(int index)
        {
            BattleUnitModel battleUnitModel = BattleObjectManager.instance.GetTargetByIndex(index);

            battleUnitModel.Revive(battleUnitModel.MaxHp);
            battleUnitModel.breakDetail.RecoverBreak(battleUnitModel.breakDetail.GetDefaultBreakGauge());
            battleUnitModel.view.EnableView(true);
            battleUnitModel.OnRoundStartOnlyUI();
            battleUnitModel.RollSpeedDice();
        }
コード例 #3
0
        public void ReturnToPassive()
        {
            Angelica.OnRoundStartOnlyUI();
            Angelica.RollSpeedDice();
            Angelica.view.charAppearance.ChangeMotion(ActionDetail.Default);
            this.owner.personalEgoDetail.AddCard(18700103);
            Active = this.owner.allyCardDetail;
            this.owner.allyCardDetail = Passive;
            this.owner.allyCardDetail.DrawCards(8);
            List <PassiveAbilityBase> list    = this.owner.passiveDetail.PassiveList;
            PassiveAbilityBase        active  = list.Find((Predicate <PassiveAbilityBase>)(x => x is PassiveAbility_1870002));
            PassiveAbilityBase        passive = new PassiveAbility_1870003(this.owner, Angelica);

            list.Remove(active);
            list.Add(passive);
            typeof(BattleUnitPassiveDetail).GetField("_passiveList", AccessTools.all).SetValue((object)this.owner.passiveDetail, (object)list);
        }
コード例 #4
0
        public override void Init(BattleUnitModel self)
        {
            base.Init(self);
            if (LevelUped.Contains(self.UnitData))
            {
                return;
            }
            List <BattleUnitModel> player = BattleObjectManager.instance.GetAliveList(Faction.Player);
            int level = 0;

            foreach (BattleUnitModel librarian in player)
            {
                level += librarian.emotionDetail.EmotionLevel;
            }
            level = level / player.Count;
            self.emotionDetail.SetEmotionLevel(level);
            self.cardSlotDetail.RecoverPlayPoint(self.cardSlotDetail.GetMaxPlayPoint());
            self.OnRoundStartOnlyUI();
            LevelUped.Add(self.UnitData);
        }
コード例 #5
0
 public override void OnUseInstance(BattleUnitModel unit, BattleDiceCardModel self, BattleUnitModel targetUnit)
 {
     new GameObject().AddComponent <SpriteFilter_Gaho>().Init("EmotionCardFilter/ThePriceOfSilence_Filter", false, 2f);
     SoundEffectPlayer.PlaySound("Creature/Clock_StopCard");
     Battle.CreatureEffect.CreatureEffect original = Resources.Load <Battle.CreatureEffect.CreatureEffect>("Prefabs/Battle/CreatureEffect/New_IllusionCardFX/9_H/FX_IllusionCard_9_H_Silence");
     if ((UnityEngine.Object)original != (UnityEngine.Object)null)
     {
         Battle.CreatureEffect.CreatureEffect creatureEffect = UnityEngine.Object.Instantiate <Battle.CreatureEffect.CreatureEffect>(original);
         creatureEffect.gameObject.transform.SetParent(SingletonBehavior <BattleManagerUI> .Instance.EffectLayer);
         creatureEffect.gameObject.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
         creatureEffect.gameObject.transform.localScale    = new Vector3(1f, 1f, 1f);
     }
     base.OnUseInstance(unit, self, targetUnit);
     unit.bufListDetail.AddBuf(new EmotionCardAbility_silence3.SilenceStun());
     unit.view.speedDiceSetterUI.DeselectAll();
     unit.OnRoundStartOnlyUI();
     unit.RollSpeedDice();
     targetUnit.bufListDetail.AddBuf(new EmotionCardAbility_silence3.SilenceStun());
     targetUnit.view.speedDiceSetterUI.DeselectAll();
     targetUnit.OnRoundStartOnlyUI();
     targetUnit.RollSpeedDice();
 }
コード例 #6
0
        public void Revive()
        {
            List <BattleUnitModel> Dead = BattleObjectManager.instance.GetFriendlyAllList(this.owner.faction).FindAll((Predicate <BattleUnitModel>)(x => x.IsDead() == true));

            Angelica = RandomUtil.SelectOne <BattleUnitModel>(Dead);
            BookModel puppet = new BookModel(Singleton <BookXmlList> .Instance.GetData(18710000));

            Contingecy_Contract.Harmony_Patch.UnitBookId.Add(Angelica, Angelica.Book.GetBookClassInfoId());
            Angelica.Book.SetHp(puppet.HP);
            Angelica.Book.SetBp(puppet.Break);
            Angelica.Book.SetSpeedDiceMax(puppet.SpeedMax);
            Angelica.Book.SetSpeedDiceMin(puppet.SpeedMin);
            Angelica.Book.SetResistHP(BehaviourDetail.Slash, puppet.GetResistHP(BehaviourDetail.Slash));
            Angelica.Book.SetResistHP(BehaviourDetail.Penetrate, puppet.GetResistHP(BehaviourDetail.Penetrate));
            Angelica.Book.SetResistHP(BehaviourDetail.Hit, puppet.GetResistHP(BehaviourDetail.Hit));
            Angelica.Book.SetResistBP(BehaviourDetail.Slash, puppet.GetResistBP(BehaviourDetail.Slash));
            Angelica.Book.SetResistBP(BehaviourDetail.Penetrate, puppet.GetResistBP(BehaviourDetail.Penetrate));
            Angelica.Book.SetResistBP(BehaviourDetail.Hit, puppet.GetResistBP(BehaviourDetail.Hit));
            Angelica.Book.GetType().GetField("_maxPlayPoint", AccessTools.all).SetValue(Angelica.Book, puppet.GetMaxPlayPoint());
            Angelica.Book.ClassInfo.id = puppet.GetBookClassInfoId();
            Angelica.view.ChangeSkin(puppet.GetCharacterName());
            Angelica.view.ChangeHeight(250);
            Angelica.formation = Singleton <StageController> .Instance.GetCurrentStageFloorModel().GetFormationPosition(Angelica.index);

            Angelica.view.charAppearance.ChangeMotion(ActionDetail.Standing);
            Angelica.cardSlotDetail.LosePlayPoint(Angelica.cardSlotDetail.GetMaxPlayPoint());
            Angelica.cardSlotDetail.RecoverPlayPoint(Angelica.cardSlotDetail.GetMaxPlayPoint());
            Angelica.Revive(Angelica.Book.HP);
            List <DiceCardXmlInfo> Decklist = new List <DiceCardXmlInfo>();

            foreach (int i in Singleton <DeckXmlList> .Instance.GetData(18710000).cardIdList)
            {
                Decklist.Add(ItemXmlDataList.instance.GetCardItem(i));
            }
            Angelica.allyCardDetail.Init(Decklist);
            Angelica.allyCardDetail.DrawCards(8);
            Angelica.personalEgoDetail = new BattlePersonalEgoCardDetail(Angelica);
            Angelica.personalEgoDetail.Init();
            Angelica.breakDetail.nextTurnBreak = false;
            Angelica.breakDetail.RecoverBreakLife(1, true);
            Angelica.bufListDetail.RemoveBufAll();
            Angelica.bufListDetail.AddBuf(new BattleUnitBuf_AngelicaPuppet(this.owner));
            Angelica.passiveDetail.PassiveList.Clear();
            Angelica.turnState = BattleUnitTurnState.WAIT_CARD;
            Angelica.OnRoundStartOnlyUI();
            Angelica.RollSpeedDice();
            Angelica.view.EnableView(true);
            Angelica.view.StartEgoSkinChangeEffect("Character");
            Angelica.moveDetail.ReturnToFormationByBlink();
            List <PassiveAbilityBase> list1 = Angelica.passiveDetail.PassiveList;

            list1.Add(new PassiveAbility_1800000(Angelica));
            list1.Add(new PassiveAbility_1870101(Angelica));
            list1.Add(new PassiveAbility_1870102(Angelica, this.owner));
            list1.Add(new PassiveAbility_1870103(Angelica));
            typeof(BattleUnitPassiveDetail).GetField("_passiveList", AccessTools.all).SetValue((object)Angelica.passiveDetail, (object)list1);
            Contingecy_Contract.ContractAttribution.Inition.Remove(Angelica);
            Contingecy_Contract.ContractAttribution.Init(Angelica);
            int num = 0;

            foreach (BattleUnitModel battleUnitModel in BattleObjectManager.instance.GetList())
            {
                SingletonBehavior <UICharacterRenderer> .Instance.SetCharacter(battleUnitModel.UnitData.unitData, num ++, renderRealtime : true);
            }
            RandomUtil.SelectOne <BattleUnitModel>(BattleObjectManager.instance.GetAliveList_opponent(this.owner.faction)).bufListDetail.AddBuf(new BattleUnitBuf_AttackTarget());
            BattleObjectManager.instance.InitUI();
            this.owner.personalEgoDetail.AddCard(18700103);
            Active = this.owner.allyCardDetail;
            this.owner.allyCardDetail = Passive;
            this.owner.allyCardDetail.DrawCards(8);
            List <PassiveAbilityBase> list2   = this.owner.passiveDetail.PassiveList;
            PassiveAbilityBase        active  = list2.Find((Predicate <PassiveAbilityBase>)(x => x is PassiveAbility_1870002));
            PassiveAbilityBase        passive = new PassiveAbility_1870003(this.owner, Angelica);

            list2.Remove(active);
            list2.Add(passive);
            typeof(BattleUnitPassiveDetail).GetField("_passiveList", AccessTools.all).SetValue((object)this.owner.passiveDetail, (object)list2);
        }