Example #1
0
    void HitHim(int idx)
    {
        if (members_[idx].ControlEntity == null)
        {
            ApplicationEntry.Instance.PostSocketErr(57557);
            return;
        }
        simpleHitCount++;
        AttaclPanel.Instance.togetherHitCrl_.SetNum(simpleHitCount);
        SkillData skill           = SkillData.GetMinxiLevelData(GlobalValue.GetAttackID(members_[idx].GetWeaponType()));
        bool      playSkillEffect = aim_.ControlEntity.PlaySkillBeattackEffect(skill._Id);

        if (playSkillEffect)
        {
            EffectAPI.Play((EFFECT_ID)skill._Beattack_effectID, aim_.ControlEntity.ActorObj);
        }
        else
        {
            int effId = aim_.ControlEntity.GetStateBeattackEffectID(skill._Id);
            EffectAPI.Play((EFFECT_ID)effId, aim_.ControlEntity.ActorObj);
        }

        int change = (int)props_[memberCount_].prop_.value_ - CurrentHp_;

        CurrentHp_ += change;
        aim_.ControlEntity.hitOver_ = props_[memberCount_].fly_;

        int[]  typs = aim_.ControlEntity.StateTypes;
        int    rtst = 0;
        string err  = "";

        GameScript.Call(ScriptGameEvent.SGE_TogetherState, new object[] { typs }, new object[] { rtst }, ref err);

        TogetherStateType tst = (TogetherStateType)rtst;//GameScript.TogetherStateEvent (ScriptGameEvent.SGE_TogetherState, aim_.ControlEntity.StateTypes);

        if (tst == TogetherStateType.TST_Self)
        {
            skipIdx = memberCount_;
            aim_.ControlEntity.PopValueChange(change, PropertyType.PT_HpCurr, aim_.battlePlayer.hpMax_, aim_.battlePlayer.mpMax_);
            includeChange += change;
        }
        else if (tst == TogetherStateType.TST_Enemy)
        {
            members_[memberCount_].ControlEntity.PopValueChange(change, PropertyType.PT_HpCurr, aim_.battlePlayer.hpMax_, aim_.battlePlayer.mpMax_);
        }

        bool hasAInvalid = hasActionInvalid();

        if (idx != members_.Length - 1)
        {
            aim_.ControlEntity.Beattack_1(skill._Id, skill._Level, !hasAInvalid, false, false, members_[memberCount_]);
        }
        else
        {
            aim_.ControlEntity.Beattack_1(skill._Id, skill._Level, !hasAInvalid, CurrentHp_ <= 0, false, members_[memberCount_]);
        }
        aim_.ControlEntity.LookAt(members_[memberCount_].ControlEntity.ActorObj);
        aim_.ControlEntity.UpdateStateTick(true);
    }
Example #2
0
    void ExcuteCounter(COM_ReportActionCounter counter)
    {
        BattleActor caster = Battle.Instance.GetActorByInstId(counter.casterId_);

        BattleActor[] aim   = new BattleActor[] { Battle.Instance.GetActorByIdx((int)counter.targetPosition_) };
        SkillInst     skill = new SkillInst();

        EffectAPI.Play((EFFECT_ID)GlobalValue.EFFECT_Fanji, caster.ControlEntity.ActorObj.transform.position + caster.ControlEntity.ActorObj.transform.forward, null, null, null, (EffectInst inst, ParamData pData) =>
        {
            EffectAPI.Play((EFFECT_ID)GlobalValue.EFFECT_FanjiCast, caster.ControlEntity.ActorObj, null, null, (int iVal) =>
            {
                skill.Cast(GlobalValue.GetAttackID(caster), 1, caster, aim, new COM_ReportTarget[] { counter.props_ }, null, DealCounterAction, true);
            });
        });
    }
Example #3
0
    void UpdateSkill()
    {
        Entity     actor = null;
        Profession prof  = null;

        switch (operatType_)
        {
        case OperateType.OT_P1:
            actor = GamePlayer.Instance;
            break;

        case OperateType.OT_B:
            actor = GamePlayer.Instance.BattleBaby;
            break;
        }

        bool disable = false;

        if (operatType_ == OperateType.OT_P1)
        {
            if (Battle.Instance.P2SkillId_ != 0 && GamePlayer.Instance.BattleBaby == null)
            {
                if (Battle.Instance.P2SkillId_ != GlobalValue.GetAttackID(GamePlayer.Instance.GetWeaponType()) &&
                    Battle.Instance.P2SkillId_ != GlobalValue.SKILL_DEFENSEID &&
                    Battle.Instance.P2SkillId_ != GlobalValue.SKILL_FLEEID)
                {
                    disable = true;
                }
            }
            //    AttaclPanel.Instance.SetButtonState(false, AttaclPanel.SKILL_BTN, AttaclPanel.ARTICLE_BTN, AttaclPanel.PET_BTN, AttaclPanel.POSITION_BTN);
        }

        if (actor != null)
        {
            prof = Profession.get((JobType)actor.GetIprop(PropertyType.PT_Profession), actor.GetIprop(PropertyType.PT_ProfessionLevel));
            GameObject       go           = null;
            SkillData        skdata       = null;
            bool             isProudSkill = false;
            List <COM_Skill> skillList    = new List <COM_Skill>(actor.SkillInsts);
            if (actor.suitSkill != null)
            {
                skillList.Add(actor.suitSkill);
            }
            int realidx = 0;
            for (int i = 0; i < skillList.Count; ++i)
            {
                skdata = SkillData.GetData((int)skillList[i].skillID_, (int)skillList[i].skillLevel_);
                if (skdata._SkillType != SkillType.SKT_Active && skdata._SkillType != SkillType.SKT_Passive)
                {
                    continue;
                }

                if (Battle.Instance.disableLst_.Contains(GetSkillIndex(skdata._Id)))
                {
                    continue;
                }

                go = GameObject.Instantiate(item_) as GameObject;
                UIManager.SetButtonEventHandler(go, EnumButtonEvent.OnClick, OnClickSkill, skdata._Id, skdata._Level);
                go.transform.parent     = grid_;
                go.transform.localScale = Vector3.one;

                UIEventListener.Get(go).parameter = disable ? 0 : 1;

                if (prof == null)
                {
                    isProudSkill = false;
                }
                else
                {
                    isProudSkill = prof.isProudSkill(actor.GetIprop(PropertyType.PT_Profession), skdata._Id, skdata._Level);
                }
                go.GetComponent <ChangeAutoIcon>().SetData(skdata._Id, skdata._Level, isProudSkill);
                go.SetActive(true);

                if (realidx == 0)
                {
                    GuideManager.Instance.RegistGuideAim(go, GuideAimType.GAT_FirstAutoSkill);
                }
                realidx++;
            }
            grid_.GetComponent <UIGrid>().Reposition();
        }
    }