private void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("Monster"))
        {
            MonsterScript monster = other.GetComponent <MonsterScript>();

            // 기존에 영역에 들어있는 몬스터가 다시 처리되면 무시
            if (!inHitAreaMonster.Contains(monster))
            {
                return;
            }

            inHitAreaMonster.Remove(monster);
        }
        else if (other.CompareTag("Beatable Object"))
        {
            BeatableObjectScript temp = other.GetComponent <BeatableObjectScript>();

            // 기존에 공격 영역에 들어있는 물건이 다시 처리되면 무시
            if (!inHitAreaObject.Contains(temp))
            {
                return;
            }

            inHitAreaObject.Remove(temp);
        }
    }
Ejemplo n.º 2
0
    private void OnEnable()
    {
        Once = false;
        ClearUI();
        TheManager = FindObjectOfType <GameManagment>();

        TheManager.Load();

        if (TheManager.ReturnPlayerMonsters().Count > 0)
        {
            Once = true;
        }

        if (Once)
        {
            TheManager.Load();
            TheManager.LoadInMonsterName();
            TheManager.GetAllMonsters();
            GenerateMonsterButtons();
        }
        else
        {
            MonsterBiengUsed = null;
            FirstTimePanelMonster.SetActive(true);
            GenerateMonsterButtons();
        }
    }
Ejemplo n.º 3
0
    // this function is the one that should make the decision to determine which child to go to
    // this function will need to return the node that it has decided is next in the list
    public override TheNode MakeDecision(MonsterScript TheMonster)
    {
        if (DecisionType == "SkillTwo")
        {
            if (Decision.SkillTwoOnCoolDown(TheMonster))
            {
                return(YesNode);
            }
            else
            {
                return(NoNode);
            }
        }
        else if (DecisionType == "SkillThree")
        {
            if (Decision.SkillThreeOnCoolDown(TheMonster))
            {
                return(YesNode);
            }
            else
            {
                return(NoNode);
            }
        }

        return(NoNode);
    }
Ejemplo n.º 4
0
    private void ScaleEnemies(MonsterScript monster, float healthScale, float speedScale)
    {
        healthScale = healthScale * WaveManager.WaveCount;
        monster.Health.UpdateHealth(healthScale, healthScale);
        monster.GetComponent<NavMeshAgent>().speed = speedScale;

        switch(WaveManager.WaveCount) {
        case 1:
            monster.GetComponent<Renderer>().material.color = Color.yellow;
            break;
        case 2:
            monster.GetComponent<Transform>().transform.localScale *= 1.2f;
            monster.GetComponent<Renderer>().material.color = Color.cyan;
            break;
        case 3:
            monster.GetComponent<Transform>().transform.localScale *= 1.4f;
            monster.GetComponent<Renderer>().material.color = Color.blue;
            break;
        case 4:
            // Final wave
            monster.GetComponent<Transform>().transform.localScale *= 1.6f;
            monster.GetComponent<Renderer>().material.color = Color.red;
            break;
        }
    }
Ejemplo n.º 5
0
    void root()
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        RaycastHit hit;

        if (Physics.Raycast(ray, out hit))
        {
            MonsterScript __target = hit.transform.gameObject.GetComponent <MonsterScript>();
            if (__target && __target.Speed > 0)
            {
                _curMp -= 30;
                __target.setSpeed(0, 2);
                audio.PlayOneShot(_snareSound);
                return;
            }
            bossScript __target2 = hit.transform.gameObject.GetComponent <bossScript>();
            if (__target2 && __target2.Speed > 0)
            {
                _curMp -= 30;
                __target2.setSpeed(0, 2);
                audio.PlayOneShot(_snareSound);
                return;
            }
        }
    }
Ejemplo n.º 6
0
    void reproduction()
    {
        //cross over caracteristics
        while (selectedMonsters.Count > 0)
        {
            int nb1 = Random.Range(0, selectedMonsters.Count);
            int nb2;
            do
            {
                nb2 = Random.Range(0, selectedMonsters.Count);
            } while (nb1 == nb2);
            if (selectedMonsters[nb1].getScore() > selectedMonsters[nb2].getScore())
            {
                selectedMonsters[nb2].reproduction(selectedMonsters[nb1]);
            }
            else
            {
                selectedMonsters[nb1].reproduction(selectedMonsters[nb2]);
            }

            MonsterScript m2 = selectedMonsters[nb2];

            monsters.Add(selectedMonsters[nb1]);
            monsters.Add(selectedMonsters[nb2]);
            //Attention !!!!!!!!!
            selectedMonsters.Remove(selectedMonsters[nb1]);
            selectedMonsters.Remove(m2);
        }

        mutation();
    }
Ejemplo n.º 7
0
    // this function is an overide of the parent class function that will have all of the base components of the parent function
    // this function will apply all of the specified effects of the skil to all of the target monsters
    // parameters :
    // the first parameter is the monster that will be using this skill
    // the second parameter is the list of monsters that will be having the effects applied to all of them
    public override void SkillActionAOE(MonsterScript ThisMonster, List <MonsterScript> TargetMonsters)
    {
        foreach (MonsterScript M in TargetMonsters)
        {
            switch (SkillEffect)
            {
            case (EffectType.BeneficialEffect):
            {
                foreach (BeneficialEffects B in BeneficialEffectsToBeApplied)
                {
                    M.AddBeneficialEffect(B);
                }
                break;
            }

            case (EffectType.HarmfulEffect):
            {
                foreach (HarmfulEffects H in HarmfulEffectsToBeApplied)
                {
                    M.AddHarmfulEffects(H);
                }
                break;
            }
            }
        }
    }
Ejemplo n.º 8
0
 //changes the string for MainMonster based on how many monsters are here and they're distance
 public void PickMainMonster()
 {
     if (!isThereADragon())
     {
         if (monsters.Count == 1) // if there's only one monster, that's the main monster!
         {
             mainMonster       = monsters[0];
             nameOfMainMonster = monsters[0].tag;
         }
         else if (monsters.Count == 0) // if there's no monsters, there's no main monster!
         {
             nameOfMainMonster = "no monster";
         }
         else
         {
             nameOfMainMonster = monsters[0].tag;
             mainMonster       = monsters[0];                       // sets the first monster as the main one by default
             for (int i = 1; i < monsters.Count; i++)               // loops through each monster in the photo
             {
                 if (monsters[i]._distance < mainMonster._distance) // checks if their distance is better than the default
                 {
                     mainMonster       = monsters[i];               // sets the best creature as the main one
                     nameOfMainMonster = monsters[i].tag;
                 }
             }
         }
     }
     else
     {
         nameOfMainMonster = "dragon";
     }
 }
Ejemplo n.º 9
0
 public void copyInto(MonsterScript m)
 {
     for (int i = 0; i < bones.Count; i++)
     {
         bones[i].copyInto(m.bones[i]);
     }
 }
Ejemplo n.º 10
0
    private void SpawnMonster()
    {
        // Pick a random direction
        Vector3 monsterSpawn = new Vector3(monsterSpawnDistance, 0, 0);

        monsterSpawn = Quaternion.AngleAxis(Random.value * 360, Vector3.forward) * monsterSpawn;

        // Instantiate the monster
        GameObject    newMonster        = Instantiate(monsterPrefab, transform.position + monsterSpawn, Quaternion.identity);
        MonsterScript monsterController = newMonster.AddComponent(typeof(MonsterScript)) as MonsterScript;

        // Forward all of the settings from the Unity editor
        monsterController.player              = gameObject;
        monsterController.monsterSpeed        = monsterSpeed;
        monsterController.monsterChaseSpeed   = monsterChaseSpeed;
        monsterController.monsterInWallSpeed  = monsterInWallSpeed;
        monsterController.monsterChaseRange   = monsterChaseRange;
        monsterController.monsterRange        = monsterRange;
        monsterController.monsterMaxHealth    = monsterMaxHealth;
        monsterController.monsterBurnSpeed    = monsterBurnSpeed;
        monsterController.monsterKillDistance = monsterKillDistance;
        monsterController.monsterKillAngle    = monsterKillAngle;

        Monsters.Add(newMonster);
    }
Ejemplo n.º 11
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Monster"))
        {
            MonsterScript monster = other.GetComponent <MonsterScript>();

            // 기존에 영역에 들어있는 몬스터가 다시 처리되면 무시
            if (inHitAreaMonster.Contains(monster))
            {
                return;
            }

            inHitAreaMonster.Add(monster);
        }
        else if (other.CompareTag("Player"))
        {
            PlayerScript player = other.GetComponent <PlayerScript>();
            Debug.Log("Hi");
            // 기존에 영역에 들어있던 플레이어면 무시
            if (inHitAreaPlayer.Contains(player))
            {
                return;
            }

            inHitAreaPlayer.Add(player);
        }
    }
Ejemplo n.º 12
0
    private void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("Monster"))
        {
            MonsterScript monster = other.GetComponent <MonsterScript>();

            // 영역에 없던 몬스터이면 무시
            if (!inHitAreaMonster.Contains(monster))
            {
                return;
            }

            inHitAreaMonster.Remove(monster);
        }
        else if (other.CompareTag("Player"))
        {
            PlayerScript player = other.GetComponent <PlayerScript>();

            // 영역에 없던 플레어어면 무시
            if (!inHitAreaPlayer.Contains(player))
            {
                return;
            }

            inHitAreaPlayer.Remove(player);
        }
    }
Ejemplo n.º 13
0
    public override void SetUp(int strong, int time)
    {
        gameObject.GetComponent <HealthScript>().ShowBuff(Indicators.stunned);
        if (!gameObject.GetComponent <SlowedScript>())
        {
            if (gameObject.GetComponent <MonsterScript>())
            {
                MonsterScript mon = gameObject.GetComponent <MonsterScript>();
                originalMovement = mon.MaxMovement;
                mon.MaxMovement  = 0;
            }
            else if (gameObject.GetComponent <CharacterScript>())
            {
                CharacterScript chara = gameObject.GetComponent <CharacterScript>();
                originalMovement          = chara.modifiedMaxMovement;
                chara.modifiedMaxMovement = 0;
            }
        }

        else
        {
            originalMovement = gameObject.GetComponent <SlowedScript>().origMovement;
            if (gameObject.GetComponent <MonsterScript>())
            {
                MonsterScript mon = gameObject.GetComponent <MonsterScript>();
                mon.MaxMovement = 0;
            }
            else if (gameObject.GetComponent <CharacterScript>())
            {
                CharacterScript chara = gameObject.GetComponent <CharacterScript>();
                chara.modifiedMaxMovement = 0;
            }
        }
    }
Ejemplo n.º 14
0
    public void InitValues(int IndexInScrollList, MonsterScript newMonster, string btnAction)
    {
        btnIndex = IndexInScrollList;
        monster = newMonster;

        monsterImageObj = Instantiate(ImagePrefab, new Vector3(-120, 0, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        monsterImageObj.transform.SetParent(this.gameObject.transform, false);
        monsterImage = monsterImageObj.GetComponent<Image>();
        monsterImage.sprite = newMonster.GetSprite();

        nameTxtObj = Instantiate(TextPrefab, new Vector3(230, 25, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        nameTxtObj.transform.SetParent(this.gameObject.transform, false);
        nameTxt = nameTxtObj.GetComponent<Text>();

        StatsTxtObj = Instantiate(StatsPrefab, new Vector3(230, 0, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        StatsTxtObj.transform.SetParent(this.gameObject.transform, false);
        StatsTxt = StatsTxtObj.GetComponent<Text>();

        LevelTxtObj = Instantiate(TextPrefab, new Vector3(230, -25, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        LevelTxtObj.transform.SetParent(this.gameObject.transform, false);
        LevelTxt = LevelTxtObj.GetComponent<Text>();

        SliderObj = Instantiate(SliderPrefab, new Vector3(260, -25, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        SliderObj.transform.SetParent(this.gameObject.transform, false);
        slider = SliderObj.GetComponent<Slider>();

        CostTxtObj = Instantiate(TextPrefab, new Vector3(320, 25, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        CostTxtObj.transform.SetParent(this.gameObject.transform, false);
        CostTxt = CostTxtObj.GetComponent<Text>();

        if (btnAction != "MISSION")
        {
            ActionBtnObj = Instantiate(ActionBtnPrefab, new Vector3(330, 25, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
            ActionBtnObj.transform.SetParent(this.gameObject.transform, false);
            ActionBtn = ActionBtnObj.GetComponent<Button>();
            ActionBtnTxt = ActionBtnObj.transform.GetChild(0).GetComponent<Text>();

            if (btnAction == "SELL") ActionBtnTxt.text = "FIRE";
        }
        else
        {
            ActionBtnObj = this.gameObject;
            ActionBtn = ActionBtnObj.GetComponent<Button>();
            ActionBtn.onClick.AddListener(() => gameManagerScript.SelectMonster(btnIndex));
        }

        nameTxt.text = monster.GetName();
        LevelTxt.text = monster.GetLevel().ToString();
        StatsTxt.text = "Stats: " + monster.GetStr().ToString() + " " + monster.GetAgi().ToString() + " " + monster.GetWill().ToString();
        CostTxt.text = "£" + monster.GetPrice().ToString();
        slider.maxValue = monster.GetXPReq();
        slider.value = monster.GetXP();

        GameManager = GameObject.FindGameObjectWithTag("GameManager");
        gameManagerScript = GameManager.GetComponent<GameManagerScript>();

        if (btnAction == "BUY") ActionBtn.onClick.AddListener(() => gameManagerScript.Buy(btnIndex));

        if (btnAction == "SELL") ActionBtn.onClick.AddListener(() => gameManagerScript.Sell(btnIndex));
    }
Ejemplo n.º 15
0
    public override void SetUp(int strong, int time)
    {
        gameObject.GetComponent<HealthScript>().ShowBuff(Indicators.disarmed);
        strength += strong;
        duration += time;
        if (gameObject.GetComponent<MonsterScript>())
        {
            MonsterScript target = gameObject.GetComponent<MonsterScript>();

            if (originalDamage != 0)
            {
                originalDamage = target.AverageDamage;
            }
            target.AverageDamage = target.AverageDamage / strength + 1;
        }
        if (gameObject.GetComponent<CharacterScript>())
        {
            CharacterScript character = gameObject.GetComponent<CharacterScript>();
            if (character.EquippedWeapon != null)
            {
                character.AverageDamage = character.CalculateWeaponDamage(character.EquippedWeapon.GetComponent<WeaponScript>());

            }
        }
    }
Ejemplo n.º 16
0
 // Use this for initialization
 void Awake()
 {
     Instance = this;
     gameObject.SetActive(false);
     _positionsToGo = new datastructures.Queue<Vector3>();
     controller = GetComponent<CharacterController>();
     _animator = GetComponent<Animator>();
 }
Ejemplo n.º 17
0
 public void reproduction(MonsterScript m)
 {
     //FAIRE MOYENNE ?
     for (int i = 0; i < bones.Count; i++)
     {
         bones[i].average(m.bones[i]);
     }
 }
Ejemplo n.º 18
0
 void Start()
 {
     //parentTransform = transform.parent;
     rb               = GetComponentInParent <Rigidbody2D>();
     monsterScript    = GetComponentInParent <MonsterScript>();
     audioSource      = GetComponent <AudioSource>();
     audioSource.loop = true;
 }
Ejemplo n.º 19
0
 void Start()
 {
     pm = PlayerMovement.me;
     ms = MonsterScript.me;
     ma = MonsterAnimation.me;
     gm = GameManager.me;
     cc = CameraController.me;
 }
Ejemplo n.º 20
0
    // this is an overide of the base function in the parent script
    // this function is what applys the skill. since this is a damage skill it will apply damage to the target monster
    // the parameters :
    // the first parameter is the monster that will be using the skill
    // the second parameter is the monster that will have the damage applied to them
    public override void SkillAction(MonsterScript ThisMonster, MonsterScript TargetMonster)
    {
        float TempDamage = SkillDamage + (SkillDamage * SkillMultiplier);

        TempDamage += ThisMonster.ReturnBaseDamage();

        TargetMonster.ApplyDamage(TempDamage, ThisMonster.ReturnBeneficialEffects(), ThisMonster.ReturnHarmfulEffects());
    }
Ejemplo n.º 21
0
    // this function is the skill that heals all of the target monsters by a certain amount that is put in
    // this is a overide function that takes it base component from the parent class
    // parameters :
    // the first parameter is the monster that will be using the skill
    // the second parameter is the all of the target monsters that are going to be healed
    public override void SkillActionAOE(MonsterScript ThisMonster, List <MonsterScript> TargetMonsters)
    {
        float TempHeal = HealAmount + (HealAmount * HealMultiplier);

        foreach (MonsterScript M in TargetMonsters)
        {
            M.ApplyHeal(TempHeal);
        }
    }
Ejemplo n.º 22
0
    //  public int monsterhp = 2;

    void Start()
    {
        this.player  = GameObject.Find("player");
        this.monster = GameObject.Find("monster");
        this.potion  = GameObject.Find("potion");
        this.weapon  = GameObject.Find("weapon");

        MonsterScript.instance = this;
    }
Ejemplo n.º 23
0
    //ルームに入室後に呼び出される
    public override void OnJoinedRoom()
    {
        //キャラクターを生成
        GameObject monster = PhotonNetwork.Instantiate("monster", Vector3.zero, Quaternion.identity, 0);
        //自分だけが操作できるようにスクリプトを有効にする
        MonsterScript monsterScript = monster.GetComponent <MonsterScript>();

        monsterScript.enabled = true;
    }
Ejemplo n.º 24
0
    // a function that updates who's turn it currently is
    public void CurrentTurnCalc()
    {
        if (PlayerMonOneHadTurn && PlayerMonTwoHadTurn && PlayerMonThreeHadTurn)
        {
            PlayerMonOneHadTurn   = false;
            PlayerMonTwoHadTurn   = false;
            PlayerMonThreeHadTurn = false;

            foreach (MonsterScript M in PlayersMonsters)
            {
                if (M.ReturnMonsterName() == PlayerMonFirst)
                {
                    CurrentMonster = M;
                    BattleUI.SetCurrentMonsterNum(1);
                }
            }

            foreach (MonsterScript M in PlayersMonsters)
            {
                if (M.GetMonsterSKills()[1].GetSkillCurrentCooldown() > 0)
                {
                    M.GetMonsterSKills()[1].SetSkillCurrentCooldown(M.GetMonsterSKills()[1].GetSkillCurrentCooldown() - 1);
                }

                if (M.GetMonsterSKills()[2].GetSkillCurrentCooldown() > 0)
                {
                    M.GetMonsterSKills()[2].SetSkillCurrentCooldown(M.GetMonsterSKills()[2].GetSkillCurrentCooldown() - 1);
                }
            }
        }
        else if (PlayerMonOneHadTurn && !PlayerMonTwoHadTurn && !PlayerMonThreeHadTurn)
        {
            foreach (MonsterScript M in PlayersMonsters)
            {
                if (M.ReturnMonsterName() == PlayerMonSecond)
                {
                    CurrentMonster = M;
                    BattleUI.SetCurrentMonsterNum(2);
                }
            }
        }
        else if (PlayerMonOneHadTurn && PlayerMonTwoHadTurn && !PlayerMonThreeHadTurn)
        {
            foreach (MonsterScript M in PlayersMonsters)
            {
                if (M.ReturnMonsterName() == PlayerMonThird)
                {
                    CurrentMonster = M;
                    BattleUI.SetCurrentMonsterNum(3);
                }
            }
        }

        BattleUI.SetCurrentMonster(CurrentMonster);
        BattleUI.UpdateSkillCooldownDisplay();
    }
Ejemplo n.º 25
0
    private void OnTriggerExit(Collider other)
    {
        MonsterScript m = other.gameObject.GetComponent <MonsterScript>();

        if (m != null)
        {
            contains.Remove(m);
            m.LeftRoom(this);
        }
    }
Ejemplo n.º 26
0
 // Start is called before the first frame update
 void Start()
 {
     Instance     = this;
     charAnimator = GetComponent <Animator>();
     // dot = GetComponent<ParticleSystem>();
     healthMonsterAwal = healthMonster;
     posX = transform.position.x;
     posY = transform.position.y;
     posZ = transform.position.z;
 }
Ejemplo n.º 27
0
 public bool DeathCheck(MonsterScript attacker, List <CharacterScript> heroes)
 {
     if (heroes.Contains((CharacterScript)attacker.enemy))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 28
0
    // this is an overide of the base function in the parent script
    // this function is what applys damage to all of the monsters that are bieng targeted. since this is a damage skill it will damage all of the monsters affected by the AOE
    // the parameters :
    // the first parameter is the monster that will be using the skill
    // the second paramerer is all of the monsters that are bieng targeted by the AOE
    public override void SkillActionAOE(MonsterScript ThisMonster, List <MonsterScript> TargetMonsters)
    {
        float TempDamage = SkillDamage + (SkillDamage * SkillMultiplier);

        TempDamage += ThisMonster.ReturnBaseDamage();

        foreach (MonsterScript M in TargetMonsters)
        {
            M.ApplyDamage(TempDamage, ThisMonster.ReturnBeneficialEffects(), ThisMonster.ReturnHarmfulEffects());
        }
    }
Ejemplo n.º 29
0
    void playerDeath()
    {
        //TODO
        //I'm not sure this will work. ALL monsters have to recieve that the player has died.
        //Debug.Log("Human Player Has died");
        MonsterScript.playerDeathReport();
        Scene thisScene = SceneManager.GetActiveScene();

        SceneManager.LoadScene(thisScene.name);
        SceneManager.LoadScene(playerLoseScreen);
    }
Ejemplo n.º 30
0
 public static void CreateRightEnemy(MonsterScript monster, WarriorAnimation player)
 {
     Transform[] wayPoints = new Transform[6];
     wayPoints[0] = GameObject.Find("WayPoint1R").transform;
     wayPoints[1] = GameObject.Find("WayPoint2R").transform;
     wayPoints[2] = GameObject.Find("WayPoint3R").transform;
     wayPoints[3] = GameObject.Find("WayPoint4R").transform;
     wayPoints[4] = GameObject.Find("WayPoint5R").transform;
     wayPoints[5] = GameObject.Find("WayPoint6R").transform;
     monster.WayPoints = wayPoints;
 }
Ejemplo n.º 31
0
 public bool SkillThreeOnCoolDown(MonsterScript TheMonster)
 {
     if (TheMonster.GetMonsterSKills()[2].GetSkillCurrentCooldown() > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 32
0
    public override void Remove()
    {
        if (gameObject.GetComponent<MonsterScript>())
        {
            MonsterScript target = gameObject.GetComponent<MonsterScript>();

            target.AverageDamage = originalDamage;

        }
        gameObject.GetComponent<HealthScript>().HideBuff(Indicators.attackBuff);
        Destroy(this);
    }
 // Use this for initialization
 void Start()
 {
     monster = gameObject.transform.root.gameObject.GetComponent <MonsterScript>();
     SettingUpInitialDamage();
     SettingUpInitialCost();
     SettingUpInitialCounterChance();
     SettingUpInitialBlockChance();
     SettingUpInitialWeaponVariation();
     SettingUpInitialSubstance();
     SettingUpInitialRange();
     SettingUpInitialWeaponType();
 }
Ejemplo n.º 34
0
 bool isThereADragon()
 {
     for (int i = 1; i < monsters.Count; i++) // loops through each monster in the photo
     {
         if (monsters[i].gameObject.tag == "dragon")
         {
             mainMonster = monsters[i];
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 35
0
    public MonsterScript GenerateMonster(bool strUp, bool agiUp, bool willUp)
    {
        ArrayList Ms = new ArrayList();
        MonsterSpieces thisMonsterSpieces;
        int str = 0, agi = 0, will = 0;
        string name = Random.Range(100,999).ToString();
        Sprite monsterSprite = Ghoul;

        Ms.Add(MonsterSpieces.ghoul);
        if (strUp)  Ms.Add(MonsterSpieces.wolfman);
        if (agiUp)  Ms.Add(MonsterSpieces.vampire);
        if (willUp) Ms.Add(MonsterSpieces.witch);

        thisMonsterSpieces = (MonsterSpieces)Ms[Random.Range(0, Ms.Count)];

        switch (thisMonsterSpieces)
        {
            case MonsterSpieces.ghoul:
                str = 1 * Random.Range(1, 3);
                agi = 1 * Random.Range(1, 3);
                will = 1 * Random.Range(1, 3);
                monsterSprite = Ghoul;
                break;
            case MonsterSpieces.wolfman:
                str = 2 * Random.Range(2, 4);
                agi = 1 * Random.Range(2, 4);
                will = 1 * Random.Range(2, 4);
                monsterSprite = Wolfman;
                break;
            case MonsterSpieces.vampire:
                str = 1 * Random.Range(2, 4);
                agi = 2 * Random.Range(2, 4);
                will = 1 * Random.Range(2, 4);
                monsterSprite = Vampire;
                break;
            case MonsterSpieces.witch:
                str = 1 * Random.Range(2, 4);
                agi = 1 * Random.Range(2, 4);
                will = 2 * Random.Range(2,4);
                monsterSprite = Witch;
                break;
        }

        int price = (str + agi + will) * 100;

        MonsterScript mon = new MonsterScript(MonsterIdCount, monsterSprite, str, agi, will, name, thisMonsterSpieces, price);
        MonsterIdCount++;
        return mon;
    }
Ejemplo n.º 36
0
 public void SelectAnimation(MonsterScript.State monsterState)
 {
     switch(monsterState)
     {
         case MonsterScript.State.IDLE:
             Anim.Play(IdleAnimation.name);
             break;
         case MonsterScript.State.FOLLOWING:
             Anim.Play(WalkAnimation.name);
             break;
         case MonsterScript.State.CHOKING:
             Anim.Play(ChokeAnimation.name);
             break;
     }
 }