Exemplo n.º 1
0
 private void DeadCheck(BattlerSerializable battler)
 {
     if (BattleLogic.DeadCheck(battler) && BattlerDictionary.IsDead(battler) == false)
     {
         BattleLogic.Dead(battler);
         BattlePresenter.GetInstance().BattlerSpriteModel.GetData(battler.uniqId).Dead.OnNext(true);
     }
 }
Exemplo n.º 2
0
        private void BattlerSpriteSubscribe()
        {
            List <int> uniqIds = EnemyDataModel.Instance.UniqIds();

            uniqIds.AddRange(MemberDataModel.Instance.UniqIds());
            uniqIds.ForEach(uniqId =>
            {
                //アクティブ時
                _container.Add(_battlerSpriteModel.GetData(uniqId).Active.Subscribe(isActive =>
                {
                    if (isActive)
                    {
                        AnnounceTextView.Instance.TurnStartText(uniqId);
                        _battlerSpriteView.DeActiveOutline();
                        _battlerSpriteView.OnActiveOutline(uniqId);
                        //メンバーの場合
                        if (BattleDictionary.IsActor(uniqId))
                        {
                            _battleModel.ActiveUniqId = uniqId;
                            _skillsView.SkillView(uniqId);
                        }
                        //敵の場合
                        else
                        {
                            _skillsView.SkillHide();
                            _battleManager.AiAction(uniqId);
                        }
                    }
                    else
                    {
                        _battlerSpriteView.DeActiveOutline();
                        _skillsView.SkillHide();
                    }
                }));
                //HPに変動があった時
                _container.Add(_battlerSpriteModel.GetData(uniqId).Hp.Subscribe(value =>
                {
                    _battlerSpriteView.HpBarRefresh(uniqId);
                }));
                //死んだ時
                _container.Add(_battlerSpriteModel.GetData(uniqId).Dead.Subscribe(isDead =>
                {
                    if (isDead)
                    {
                        _battlerSpriteView.Dead(uniqId);
                        BattleLogic.Dead(BattlerDictionary.GetBattlerByUniqId(uniqId));
                        //PlaySe.GetInstance().Play("SE/Miscs/MonsterDie");
                    }
                }));
                //状態異常にかかった時
                _container.Add(_battlerSpriteModel.GetData(uniqId).Status.Subscribe(_ =>
                {
                    _battlerSpriteView.StatusIconRefresh(uniqId);
                }));
            });
        }