Exemplo n.º 1
0
    private void EmitAttackFontInvoke(EmitEffectFontData effectFontData)
    {
        BattleBloodControl bloodControl = Globals.Instance.MGUIManager.GetGUIWindow <GUIBattleMain>().bloodControl;

        if (bloodControl == null)
        {
            Debug.Log("bloodControl is null");
            return;
        }

        GameData.BattleGameData.AttackState attackState = effectFontData._currAttackState;
        GameObject gameObject = effectFontData._thisGameObject;

        Vector3 worldPos = gameObject.transform.position;

        worldPos.z += FightCellSlot.EffectSkillNameOffset;
        Vector3 offset = new Vector3(0f, 20f, 0f);

        switch (attackState)
        {
        case GameData.BattleGameData.AttackState.NORMAL_ATTACK:
        case GameData.BattleGameData.AttackState.SKILL_ATTACK:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.SKILL, 0, effectFontData.skillName);
            break;

        case GameData.BattleGameData.AttackState.NORMAL_ATTACK_CRIT:
        case GameData.BattleGameData.AttackState.SKILL_ATTACK_CRIT:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.CRIT_SKILL, 0, effectFontData.skillName);
            break;

        case GameData.BattleGameData.AttackState.TREAT_SKILL_ATTACKED:
        case GameData.BattleGameData.AttackState.REDUCE_DAMAGE_SKILL_ATTACKED:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.SKILL, 0, effectFontData.skillName);
            break;

        default:
            Debug.LogError("Error AttackState EmitAttackFontInvoke " + attackState);
            break;
        }
    }
Exemplo n.º 2
0
    private void EmitBeAttackedFontInvoke(EmitEffectFontData effectFontData)
    {
        GameData.BattleGameData.AttackedState currentAttackState = effectFontData._currBeAttackedState;
        GameObject gameObject = effectFontData._thisGameObject;
        int        damage     = effectFontData._currentEffectFontDamage;

        BattleBloodControl bloodControl = Globals.Instance.MGUIManager.GetGUIWindow <GUIBattleMain>().bloodControl;

        if (bloodControl == null)
        {
            Debug.Log("bloodControl is null");
            return;
        }

        // tzz modified for Refactoring
        Vector3 worldPos = gameObject.transform.position;

        worldPos.z += FightCellSlot.EffectDamageBloodOffset;
        Vector3 offset = new Vector3(0f, 20f, 0f);

        switch (currentAttackState)
        {
        case GameData.BattleGameData.AttackedState.DODGE:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.DODGE, damage, "");
            break;

        case GameData.BattleGameData.AttackedState.NORMAL_ATTACKED:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.NUMBER_GRAY, damage, "");
            break;

        case GameData.BattleGameData.AttackedState.NORMAL_CRIT:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.NUMBER_RED, damage, "");
            break;

        case GameData.BattleGameData.AttackedState.SKILL_ATTACKED:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.NUMBER_GRAY, damage, "");
            break;

        case GameData.BattleGameData.AttackedState.SKILL_CRIT:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.NUMBER_RED, damage, "");
            break;

        case GameData.BattleGameData.AttackedState.TREAT_SKILL_ATTACKED:
        case GameData.BattleGameData.AttackedState.REDUCE_DAMAGE_SKILL_ATTACKED:
            bloodControl.EmitEffectFont(gameObject.transform, worldPos, offset, BattleEffectFont.EffectType.NUMBER_GREEN, damage, "");
            break;

        default:
            Debug.LogError("Error AttackedState EmitBeAttackedFontInvoke " + currentAttackState);
            break;
        }
    }
Exemplo n.º 3
0
    public void Attack(SkillDataSlot skillData)
    {
        // Assign the real normal attack skill id
        if (skillData._skillID == 0)
        {
            EWarshipTypeID type = (EWarshipTypeID)Property.TypeID;
            switch (type)
            {
            case EWarshipTypeID.AIRCRAFT_CARRIER:
            {
                skillData._skillID = NormaAttackDefine.NORMAL_AIRCRAFT_CARRIER;
                break;
            }

            case EWarshipTypeID.UNDER_WATER_CRAFT:
            {
                skillData._skillID = NormaAttackDefine.NORMAL_UNDER_WATER_CRAFT;
                break;
            }

            default:
            {
                skillData._skillID = NormaAttackDefine.NORMAL_CANNON_CRAFT;
                break;
            }
            }
        }

        // Fill in skill data from DataTable
        skillData.MSkillData.BasicData.SkillLogicID = skillData._skillID;
        skillData.MSkillData.FillDataFromConfig();

        // Create skill, and execute the skill logic
        Skill skill = Globals.Instance.MSkillManager.CreateSkill(skillData, this);

        skill.StartSkill();

        // add attack effect font
        GameData.BattleGameData.AttackState attackState = (GameData.BattleGameData.AttackState)skillData._attckerAttackState;
        BattleBloodControl bloodControl = Globals.Instance.MGUIManager.GetGUIWindow <GUIBattle>()._bloodControl;

        if (attackState == GameData.BattleGameData.AttackState.NORMAL_ATTACK_CRIT)
        {
            bloodControl.EmitEffectFont(_thisGameObject.transform, _thisGameObject.transform.position, new Vector3(0f, 40f, 0f), BattleEffectFont.EffectType.CRIT, 0, "");
        }
        else if (attackState == GameData.BattleGameData.AttackState.SKILL_ATTACK)
        {
            // Only skill attack allow display effect font
            if (!skillData.MSkillData.BasicData.SkillIsNormalAttack)
            {
                bloodControl.EmitEffectFont(_thisGameObject.transform,
                                            _thisGameObject.transform.position, new Vector3(0f, 30f, 0f), BattleEffectFont.EffectType.SKILL, 0, skillData.MSkillData.BasicData.SkillName);
            }
        }
        else if (attackState == GameData.BattleGameData.AttackState.SKILL_ATTACK_CRIT)
        {
            bloodControl.EmitEffectFont(_thisGameObject.transform, _thisGameObject.transform.position, new Vector3(0f, 40f, 0f), BattleEffectFont.EffectType.CRIT_SKILL, 0, skillData.MSkillData.BasicData.SkillName);
        }
        else if (attackState == GameData.BattleGameData.AttackState.TREAT_SKILL_ATTACKED ||
                 attackState == GameData.BattleGameData.AttackState.REDUCE_DAMAGE_SKILL_ATTACKED)
        {
            // tzz added for display name of TREAT_SKILL_ATTACKED and REDUCE_DAMAGE_SKILL_ATTACKED
            //
            bloodControl.EmitEffectFont(_thisGameObject.transform,
                                        _thisGameObject.transform.position, new Vector3(0f, 30f, 0f), BattleEffectFont.EffectType.SKILL, 0, skillData.MSkillData.BasicData.SkillName);
        }
    }