Ejemplo n.º 1
0
    // Spawn in a monster
    public void SpawnMonster(GameObject monster, MONSTERTYPE monsterType, int monsterHealth)
    {
        // Set initial position
        map.PositionGameObjectInEmptyCube(monster);

        // Set the monster type and health
        MonsterController monsterController = monster.GetComponent <MonsterController>();

        monsterController.typeOfMonster(monsterType);
        monsterController.GetComponent <MonsterHealth>().SetCurrentAndMaxHealth(monsterHealth);

        // While the monster is closer to the player than minimum monster to player distance reposition the monster
        while (Vector3.Distance(monster.transform.position, player.transform.position) < minMonsterToPlayerDistance)
        {
            map.PositionGameObjectInEmptyCube(monster);
        }

        // Record the monster in the lists
        if (monsterType == MONSTERTYPE.BASIC)
        {
            monsterController.Index(GameDataManager.instance.RecordMonsterBasicPosition(monster.transform.position));
        }
        if (monsterType == MONSTERTYPE.JUICY)
        {
            monsterController.Index(GameDataManager.instance.RecordMonsterJuicyPosition(monster.transform.position));
        }
    }
Ejemplo n.º 2
0
 // 근,원거리 여부, 몬스터 이름, 체력, 데미지, 속도, 추격범위, 공격범위 (디폴트 매개변수가 있으니 공격범위, 이동속도는 지정 안해줘도됨), 원거리 공격 방법
 void MobSetting(MONSTERTYPE type, MONSTERLIST name, int hp, int dmg, float chaserg, float attackrg = 0.0f, float speed = 0.0f, int attacktype = 0)
 {
     MobType            = type;
     MobName            = name;
     nMonsterHp         = hp;
     nMonsterDmg        = dmg;
     ChaseRange         = chaserg;
     fMonsterSpeed      = speed;
     fSaveSpeed         = fMonsterSpeed;
     AttackRange        = attackrg;
     nMonsterAttackType = attacktype;
 }
Ejemplo n.º 3
0
 public void AddToMonsterCount(MONSTERTYPE type)
 {
     if (type == MONSTERTYPE.BASIC)
     {
         monstersBasic++;
         monstersTotal++;
     }
     if (type == MONSTERTYPE.JUICY)
     {
         monstersJuicy++;
         monstersTotal++;
     }
 }
Ejemplo n.º 4
0
    public void MonsterKilled(MONSTERTYPE type, int index, Vector3 killedPos, bool killedInQuest)
    {
        if (type == MONSTERTYPE.BASIC)
        {
            monstersKilledBasic++;
        }
        if (type == MONSTERTYPE.JUICY)
        {
            monstersKilledJuicy++;
        }

        MonsterKilledStats(type, index, killedPos, killedInQuest);
        monstersKilledTotal++;
    }
Ejemplo n.º 5
0
 public void MonsterKilledStats(MONSTERTYPE type, int index, Vector3 killedPos, bool killedInQuest)
 {
     if (type == MONSTERTYPE.BASIC)
     {
         monsterKilledStatsBasicList[index].killed        = true;
         monsterKilledStatsBasicList[index].killedTime    = gameTime;
         monsterKilledStatsBasicList[index].killedPos     = killedPos;
         monsterKilledStatsBasicList[index].killedInQuest = killedInQuest;
     }
     if (type == MONSTERTYPE.JUICY)
     {
         monsterKilledStatsJuicyList[index].killed        = true;
         monsterKilledStatsJuicyList[index].killedTime    = gameTime;
         monsterKilledStatsJuicyList[index].killedPos     = killedPos;
         monsterKilledStatsJuicyList[index].killedInQuest = killedInQuest;
     }
 }
Ejemplo n.º 6
0
 public void typeOfMonster(MONSTERTYPE type)
 {
     monsterType = type;
 }