Пример #1
0
    [Command] void CmdDealDamage(GameObject damaged, int attacktype, GameObject damager)
    {
        if (damaged != null)
        {
            if (damaged.GetComponent <PlayerHealth>() != null)
            {
                PlayerHealth PH = damaged.GetComponent <PlayerHealth>();
                if (!PH)
                {
                    return;
                }
                PH.dealDamage(attacktype, damager);
            }

            else if (damaged.GetComponent <SmallMonsters>() != null)
            {
                SmallMonsters SM = damaged.GetComponent <SmallMonsters>();
                if (!SM)
                {
                    return;
                }
                SM.dealDamage(attacktype, damager);
            }

            else if (damaged.GetComponent <monsterScript>() != null)
            {
                monsterScript MS = damaged.GetComponent <monsterScript>();
                if (!MS)
                {
                    return;
                }
                MS.dealDamage(attacktype, damager);
            }
        }
    }
Пример #2
0
    public void addingAMonster()
    {
        monsterScript Monster = gameObject.AddComponent(typeof(monsterScript)) as monsterScript;

        Monster.MonsterInfo.MonsterType = monsterScript.Type.Char_Star;
        PlayerInventory.AddMonseter(Monster);
        Debug.Log("Added Char_Star");
        Debug.Log(UserInfo.SignedIn);
        Debug.Log(PlayerInventory.Inventory.InventoryList[0] + "\n" + PlayerInventory.Inventory.InventoryList[1]);
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        totalLanterns     = allLanterns.Count;
        monsterHandle     = GameObject.FindObjectOfType <monsterScript>();
        screenFaderHandle = GameObject.FindObjectOfType <ScreenFader>();
        scoreTextHandle   = GameObject.FindObjectOfType <mainGUItext>();
        mainLightHandle   = GameObject.FindObjectOfType <mainLight>();

        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("platform"))
        {
            platformHandle = obj.GetComponent <Animator>();
        }
    }
Пример #4
0
 // Use this for initialization
 void Awake()
 {
     if (!initialized)
     {
         initialized = true;
         Inventory   = new ListWrapper();
         //monsterScript DefaultMonster = ScriptableObject.CreateInstance<monsterScript>();
         //monsterScript DefaultMonster = new monsterScript();
         //DefaultMonster.Awake();
         //AddMonster(DefaultMonster);
         monsterScript DefaultMonster = gameObject.AddComponent(typeof(monsterScript)) as monsterScript;
         DefaultMonster.type = monsterScript.Type.Char_Star;
         AddMonseter(DefaultMonster);
     }
 }
    void Start()
    {
        spriteR = GetComponent <SpriteRenderer>();
        sprites = Resources.LoadAll <Sprite>("EnemySprites");
        Monster = GetComponent <monsterScript>();

        if (Monster.type == monsterScript.Type.BLOB)
        {
            LoadMonsterSprite(1);
        }
        else if (Monster.type == monsterScript.Type.Char_Star)
        {
            LoadMonsterSprite(567);
        }
        else if (Monster.type == monsterScript.Type.Long)
        {
            LoadMonsterSprite(232);
        }
    }
Пример #6
0
    // Use this for initialization
    void Awake()
    {
        battle    = false;
        playerWin = false;

        enemy = Monster;
        enemy.GetComponent <monsterScript>().Awake();

        player = Player;
        List <monsterScript.Type> inventory = PlayerInventory.Inventory.InventoryList;

        PlayerMonsterFromPlayer      = new monsterScript();
        PlayerMonsterFromPlayer.type = inventory[0];
        PlayerMonsterFromPlayer.Awake();
        Debug.Log("DEBUG HERE: " + PlayerMonsterFromPlayer.type);
        moveOne.GetComponentInChildren <Text>().text = PlayerMonsterFromPlayer.MonsterInfo.moves[0].moveName;
        moveTwo.GetComponentInChildren <Text>().text = PlayerMonsterFromPlayer.MonsterInfo.moves[1].moveName;
        nextTurn();
    }
Пример #7
0
 public static void AddMonseter(monsterScript monster)
 {
     Inventory.InventoryList.Add(monster.MonsterInfo.MonsterType);
 }
Пример #8
0
 public static void RemoveMonseter(monsterScript monster)
 {
     Inventory.InventoryList.Remove(monster.MonsterInfo.MonsterType);
 }