Example #1
0
    protected override void Start()
    {
        m_DefaultSpriteFlipX = ParentSkill.SkillSpriteRenderer.flipX;
        m_SkillDirection     = (BattleGlobals.IsHeroTeamTag(ParentSkill.SkillOwner.tag)) ? Vector2.left : Vector2.right;

        base.Start();
    }
Example #2
0
    /*
     * Check if this skill is configured to hit this BattleNPC
     * @param: b - BattleNPC beam says it hit
     * @returns: bool - true if configured to hit b, false if not configured to hit b
     */
    private bool _checkValidDamage(BattleNPC hitNPC)
    {
        bool heroTeam = BattleGlobals.IsHeroTeamTag(hitNPC.tag);

        return(otherTeamValidTargets || (Target == TargetType.AnyTarget) ||
               ((Target == TargetType.AlliedTargets) && heroTeam) ||
               ((Target == TargetType.EnemyTargets) && !heroTeam));
    }
Example #3
0
 // Use this for initialization
 void Awake()
 {
     m_Rigid2d         = GameGlobals.AttachCheckComponent <Rigidbody2D>(this.gameObject);
     m_ParentSkillByte = GameGlobals.AttachCheckComponentParent <ProjectileAttackByte>(this.gameObject);
     m_SpriteRenderer  = GameGlobals.AttachCheckComponent <SpriteRenderer>(this.gameObject);
     this.tag          = (BattleGlobals.IsHeroTeamTag(m_ParentSkillByte.ParentSkill.SkillOwner.tag)) ?
                         BattleGlobals.TAG_FOR_HERO_PROJ : BattleGlobals.TAG_FOR_ENEMY_PROJ;
     this.name = GameGlobals.TrimCloneFromName(this.name) +
                 "(" + m_ParentSkillByte.ParentSkill.SkillOwner + ")";
     // If the object is homing, this does not matter
     m_ProjDirection = (this.gameObject.CompareTag(BattleGlobals.TAG_FOR_HERO_PROJ)) ?
                       Vector2.left : Vector2.right;
     m_mainTarget = null;
 }