Example #1
0
    /// <summary>
    /// Mobs are generated here and stored statically into __MobsDict.MOBS_DICT Dictionary
    /// </summary>
    private void GenerateMobs()
    {
        short mobsPerZone = 9;
        short maxZones    = 10;
        short counter     = 1;

        for (short i = 1; i != maxZones; i++)
        {
            __MobsDataStruct tempMobDataStruct = new __MobsDataStruct();
            tempMobDataStruct.Mobs = new List <__MobData>(9);

            for (short j = 1; j != mobsPerZone + 1; j++)
            {
                __MobData mobData = new __MobData
                {
                    ID          = counter,
                    LVL         = counter,
                    mmName      = "mob" + counter,
                    HP          = 100f,
                    AttackSpeed = Math.Pow(5f, 1.2f),
                    ATTACK      = 2 * counter,
                    DEFENSE     = 3 * counter,
                    image       = null
                };
                //Debug.Log(mobData.LVL);
                tempMobDataStruct.Mobs.Add(mobData);
                ++counter;
            }
            __MobsDict.MOBS_DICT.Add(i, tempMobDataStruct);

            //Debug.Log(__MobsDict.MOBS_DICT[i].Mobs[i-1].mmName);
        }
    }
Example #2
0
    void Awake()
    {
        //GameObject.Find("Background").gameObject.GetComponentInChildren<UnityEngine.UI.Image>().sprite = __FightScene.background.sprite; // TO BE SET LATER

        PlayerHealthBar   = GameObject.Find("PlayerHealth").GetComponent <Image>();
        OpponentHealthBar = GameObject.Find("OpponentHealth").GetComponent <Image>();

        PlayerHealthBar.fillAmount   = 1f;
        OpponentHealthBar.fillAmount = 1f;

        player   = __FightScene.player;
        opponent = __FightScene.opponent;

        player_MAX_HP       = player.HP;
        player_Current_HP   = player.HP;
        opponent_MAX_HP     = opponent.HP;
        opponent_Current_HP = opponent.HP;

        player_Current_HP = 40;

        PlayerHealthBar.fillAmount   = player_Current_HP / player_MAX_HP;
        OpponentHealthBar.fillAmount = opponent_Current_HP / opponent_MAX_HP;

        Debug.Log(player.ccNAME);
        Debug.Log(opponent.mmName);
    }
Example #3
0
    void Start()
    {
        //Debug.LogWarning("MobSlot.cs => zoneID: " + zoneID + " mobID " + mobID);

        data       = new __MobData();
        tempStruct = new __MobsDataStruct();
        tempStruct = __MobsDict.MOBS_DICT[zoneID];
        data       = tempStruct.Mobs[mobID];
        this.GetComponent <Button>().GetComponentInChildren <Text>().text = data.mmName;

        gameObject.GetComponent <Button>().onClick.AddListener(StartFight);
    }