Пример #1
0
    public override void DoEffect(BaseCharacter user)
    {
        LevelGenerate Map = GameObject.Find("MapGeneration").GetComponent <LevelGenerate>();

        Vector3 mapPos = new Vector3(user.pos.x, user.pos.y, 0);

        List <BaseCharacter> AffectedCharacters = Map.GetCharactersInRange(mapPos, Range);

        foreach (BaseCharacter aCharacter in AffectedCharacters)
        {
            GameObject.Find(aCharacter.name).GetComponent <BaseCharacter>().TakeDamage(30);

            //GameObject.Find("EffectsSoundPlayer").GetComponent<SoundManager>().PlaySound("FugoSkill");
            PersistentSoundManager.m_Instance.PlaySoundEffect("FugoSkill");

            Debug.Log("Damage Taken!");
        }

        List <Vector3> CheckedPos     = new List <Vector3>();
        List <Vector3> ExplosionTiles = RecursiveFindTiles(mapPos, Range, CheckedPos);

        foreach (Vector3 aPos in ExplosionTiles)
        {
            GameObject go = Instantiate(Animation, aPos, Quaternion.identity) as GameObject;
            go.GetComponent <CleanUp>().enabled = true;
        }
    }
Пример #2
0
    public override void DoEffect(BaseCharacter user)
    {
        LevelGenerate Map = GameObject.Find("MapGeneration").GetComponent <LevelGenerate>();

        Vector3 mapPos = new Vector3(user.pos.x, user.pos.y, 0);

        BaseCharacter check1 = user.theLevel.GetCharacterInTile(mapPos + new Vector3(0, 1, 0));

        if (check1 != null)
        {
            GameObject.Find(check1.name).GetComponent <BaseCharacter>().TakeDamage(3);
            Debug.Log("Damage Taken!");
        }
        BaseCharacter check2 = user.theLevel.GetCharacterInTile(mapPos + new Vector3(0, 2, 0));

        if (check2 != null)
        {
            GameObject.Find(check2.name).GetComponent <BaseCharacter>().TakeDamage(2);
            Debug.Log("Damage Taken!");
        }

        GameObject go = Instantiate(Animation, mapPos + new Vector3(0, 1, 0), Quaternion.identity) as GameObject;

        go.GetComponent <CleanUp>().enabled = true;

        go = Instantiate(Animation, mapPos + new Vector3(0, 2, 0), Quaternion.identity) as GameObject;
        go.GetComponent <CleanUp>().enabled = true;
    }
Пример #3
0
 void Awake()
 {
     if (instence == null)
     {
         instence = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Пример #4
0
    public override void DoEffect(BaseCharacter user)
    {
        LevelGenerate Map = GameObject.Find("MapGeneration").GetComponent <LevelGenerate>();

        Modifier toAdd = new Modifier();

        toAdd.Init(Modifier.MODIFY_TYPE.ARMOUR, -Amount, 1);
        GameObject.Find(user.name).GetComponent <BaseCharacter>().AddModifier(toAdd);

        toAdd = new Modifier();
        toAdd.Init(Modifier.MODIFY_TYPE.SPEED, Amount, 1);
        GameObject.Find(user.name).GetComponent <BaseCharacter>().AddModifier(toAdd);
    }
Пример #5
0
    public override void DoEffect(BaseCharacter user)
    {
        LevelGenerate Map = GameObject.Find("MapGeneration").GetComponent <LevelGenerate>();

        Vector3 mapPos = new Vector3(user.pos.x, user.pos.y, 0);

        List <BaseCharacter> AffectedCharacters = Map.GetCharactersInRange(mapPos, Range);

        foreach (BaseCharacter aCharacter in AffectedCharacters)
        {
            Modifier toAdd = new Modifier();
            toAdd.Init(Modifier.MODIFY_TYPE.HEALTH, 2, 1);
            GameObject.Find(aCharacter.name).GetComponent <BaseCharacter>().AddModifier(toAdd);
        }
    }