Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (m_ParentSkillByte.Homing)
        {
            BattleGlobals.HomingMovement(m_Rigid2d, m_mainTarget.transform.position,
                                         m_ParentSkillByte.ParentSkill.SkillOwner.NPCProjSpeedMultiplier.GetBuffAffectedValue() *
                                         m_ParentSkillByte.ByteSpeed);
        }
        else
        {
            BattleGlobals.NonHomingMovement(m_Rigid2d,
                                            m_ProjDirection *
                                            m_ParentSkillByte.ParentSkill.SkillOwner.NPCProjSpeedMultiplier.GetBuffAffectedValue() *
                                            m_ParentSkillByte.ByteSpeed);

            // When we are out of sight, we missed
            if (!m_SpriteRenderer.isVisible)
            {
                m_ParentSkillByte.DeRegisterProjectile(this);
            }
        }
    }
Beispiel #2
0
    public override void DoByte()
    {
        AnimateOwner(BattleGlobals.ANIMATE_NPC_ATTACK);

        ApplyOnCastBuffs();

        if (Homing)
        {
            BattleGlobals.HomingMovement(ParentSkill.SkillOwner.NPCRigidBody2D,
                                         NPCTargets[MELEE_ATTACK_PRIMARY_TARGET_INDEX].Focus.transform.position,
                                         (ParentSkill.SkillOwner.NPCMoveSpeedMultiplier.GetBuffAffectedValue() * ByteSpeed));
        }
        else
        {
            BattleGlobals.NonHomingMovement(ParentSkill.SkillOwner.NPCRigidBody2D,
                                            m_SkillDirection * (NON_HOMING_SPEED_MULTIPLIER *
                                                                ParentSkill.SkillOwner.NPCMoveSpeedMultiplier.GetBuffAffectedValue() * ByteSpeed));

            if (!ParentSkill.SkillOwner.NPCSpriteRender.isVisible)
            {
                OnSkillByteHit(null);
            }
        }
    }