Ejemplo n.º 1
0
 private void SetAgentInformation(NavMeshAgent agent, EnemyInformation information)
 {
     agent.stoppingDistance = information.AI.StopDistance;
     agent.speed            = information.AI.Speed;
     agent.height           = information.AI.Height;
     agent.radius           = information.AI.Radius;
 }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (enemy != null)
        {
            ei = enemy.GetComponent<EnemyInformation>();
            HP = (int)ei.curHP;

            if (ei.isDead)
            {
                CancelInvoke("attack");
                AISearching search = GetComponent<AISearching>();
                search.enabled = true;
                this.enabled = false;
            }

            float dis = Vector3.Distance(this.transform.position, enemy.transform.position);

            if (dis >= 7)
            {
                CancelInvoke("attack");

                AIApproaching approach = this.GetComponent<AIApproaching>();
                approach.enabled = true;
                approach.enemy = enemy;
                approach.isApproachEnemy = true;
                approach.isApproachPlayer = false;

                this.enabled = false;
            }
        }
    }
Ejemplo n.º 3
0
    private void SetHealthOnHeatlhtBar(EnemyInformation info)
    {
        Canvas enCanvas = playerCombat.TargetForCombat.Find("HealthBarCanvas(Clone)").GetComponent<Canvas>();
        Image healthImage = enCanvas.transform.Find("HealthBackGround/Health").GetComponent<Image>();

        healthImage.fillAmount =(float)info.Health / (float)info.MaxHealth;
    }
Ejemplo n.º 4
0
 private void OnTriggerEnter(Collider collision)
 {
     if (collision.gameObject.GetComponent <EnemyInformation>())
     {
         EnemyInformation enemy = collision.gameObject.GetComponent <EnemyInformation>();
         enemy.PlayerHealth -= damage;
         //Call PopupDamage Function.
         //Debug.Log("Hit Enemy");
         //text = GameObject.FindGameObjectWithTag("UiManager").GetComponent<FloatingText>();
         //text.DamageText(gameObject.transform.position, damage, collision.gameObject);
         GameObject temp = Instantiate(Resources.Load <GameObject>("FloatingText/TextPrefab"));
         temp.GetComponent <TextMesh>().text = damage.ToString();
         temp.transform.position             = new Vector3(collision.transform.position.x, GameObject.FindGameObjectWithTag("Player").transform.position.y + 3.0f, collision.transform.position.z);
         Destroy(temp, 0.6f);
         Destroy(this.gameObject);
     }
     else if (collision.gameObject.tag == "Player")
     {
         Debug.Log(this.gameObject);
         GameInformation.PlayerHealth -= damage;
         Destroy(this.gameObject);
     }
     else if (collision.gameObject.tag == "Summon")
     {
         SummonInfo summon = collision.GetComponent <SummonsAi>().summon;
         summon.SummonHealth -= damage;
         Debug.Log(summon.SummonHealth);
         Destroy(this.gameObject);
     }
     //Destroy(this.gameObject);
 }
Ejemplo n.º 5
0
    public float GetEnemyDamage(int baseDamageAdditive, int crit, EnemyInformation enemy)// Damage Additive will be the damage with the main stats of that effect the abilities.
    {
        int baseEneDamage = 2 * (enemy.PlayerLevel / 4);

        crit += baseCritChance;
        int random = Random.Range(0, 200);

        damageModifyer = enemy.MainStat * (int)Scalar.damageMultiple;
        if (random <= crit)
        {
            float temp = baseDamageAdditive * 0.3f;
            baseDamageAdditive = (int)temp;
            damage             = baseEneDamage * damageModifyer;
            Debug.Log(damage);
            return((damage + baseDamageAdditive) * (2f)); // Crit Calculation Set!
        }
        else
        {
            float temp = baseDamageAdditive * 0.3f;
            baseDamageAdditive = (int)temp;
            damage             = baseEneDamage * damageModifyer;
            Debug.Log(damage);
            return(damage + baseDamageAdditive);
        }
    }
 private void FillDatabase()
 {
     EnemyInformation ei1 = new EnemyInformation() { StaticID = "E_1", Name = "CUbe", Health = 150, MaxHealth = 150,
         CurrentHealth=150, Attack = 5, ExpGained = 10 };
     ei1.EnemyCard = itemDatabase.GetCard("R_3");
     allEnemys.Add(ei1);
 }
Ejemplo n.º 7
0
 void Start()
 {
     itemDatabase = Repository.GetItemDatabaseInstance();
     information = GetComponent<Enemy>().GetEnemyInformation();
     playerCombat = GameObject.Find("PlayerObject").GetComponent<PlayerCombat>();
     manager.OnMenuClosing += manager_OnMenuClosing;
     canBeTarget = true;
     numberOfLoot = information.DropLoot.Count;
 }
Ejemplo n.º 8
0
 public void ShowInstruction(EnemyInformation info)
 {
     panelInstruction.SetActive(true);
     Time.timeScale = 0;
     panelInstruction.GetComponent <Animator>().Play("Appear");
     panelInstruction.GetComponentInChildren <Image>().sprite         = info.sprite;
     panelInstruction.GetComponentInChildren <Image>().color          = info.color;
     panelInstruction.GetComponentInChildren <TextMeshProUGUI>().text = info.name + ": " + info.description;
     //StartCoroutine(ExecuteHideMessage(3, panelInstruction.GetComponent<Animator>()));
     StartCoroutine(ExecuteHideInstruction());
 }
Ejemplo n.º 9
0
 private void OnTriggerEnter(Collider collision)
 {
     // <- gotta check for max hp
     if (collision.gameObject.GetComponent <EnemyInformation>() && user.GetComponent <EnemyInformation>())
     {
         EnemyInformation enemy = collision.gameObject.GetComponent <EnemyInformation>();
         if (enemy.PlayerHealth + heal > enemy.PlayerMaxHealth)
         {
             enemy.PlayerHealth = enemy.PlayerMaxHealth;
         }
         else
         {
             enemy.PlayerHealth += heal;
         }
         text = GameObject.FindGameObjectWithTag("UiManager").GetComponent <FloatingText>();
         text.DamageText(gameObject.transform.position, heal, collision.gameObject, Color.green);
         Destroy(this.gameObject);
     }
     else if (collision.gameObject.tag == "Player")
     {
         Debug.Log(this.gameObject);
         if (GameInformation.PlayerHealth + heal > GameInformation.PlayerMaxHp)
         {
             GameInformation.PlayerHealth = GameInformation.PlayerMaxHp;
         }
         else
         {
             GameInformation.PlayerHealth += heal;
         }
         Debug.Log("Healed: " + heal);
         Destroy(this.gameObject);
     }
     else if (collision.gameObject.tag == "Summon")
     {
         SummonInfo summon = collision.GetComponent <SummonsAi>().summon;
         if (summon.SummonHealth + heal > summon.SummonMaxHealth)
         {
             summon.SummonHealth = summon.SummonMaxHealth;
         }
         else
         {
             summon.SummonHealth += heal;
         }
         if (summon.SummonHealth > summon.SummonMaxHealth)
         {
             summon.SummonHealth = summon.SummonMaxHealth;
         }
         text = GameObject.FindGameObjectWithTag("UiManager").GetComponent <FloatingText>();
         text.DamageText(gameObject.transform.position, heal, collision.gameObject, Color.green);
         Debug.Log(summon.SummonHealth);
         Destroy(this.gameObject);
     }
     //Destroy(this.gameObject);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Create gameobjects as children of this formation after initial CreateChildren
 /// </summary>
 /// <param name="count"></param>
 private void AddChildren(int count)
 {
     for (int i = 0; i < count; i++)
     {
         GameObject child = new GameObject();
         child.name                       = "Enemy";
         child.transform.parent           = this.transform;
         child.transform.position         = new Vector3(0f, 6.5f, 0f);
         children[currentNumChildren + i] = new EnemyInformation(child, EnemyType.shooter, child.AddComponent <EnemyPosition>());
         emptyChildrenList.Add(child);
     }
 }
Ejemplo n.º 11
0
 private void CreateChildren(int count)
 {
     // Create child gameobjects
     for (int i = 0; i < count; i++)
     {
         GameObject child = new GameObject();
         child.name               = "Enemy";
         child.transform.parent   = this.transform;
         child.transform.position = new Vector3(10f, 0f, 0f);
         children[i]              = new EnemyInformation(child, EnemyType.shooter, child.AddComponent <EnemyPosition>());
         emptyChildrenList.Add(child);
     }
 }
Ejemplo n.º 12
0
    void Start()
    {
        //abilities.Add(new Teleport(anim, 0));
        abilities.Add(new EnergyShot(anim, 0));

        enemyInfo = new EnemyInformation(this.gameObject.name);
        movement  = new EnemyMovement(enemyInfo, this.gameObject);
        ai        = new AI(enemyInfo, this.gameObject, abilities, movement);


        enemyInfo.CurrentHealth  = enemyInfo.MaxHealth;
        movement.MovementEnabled = true;
    }
Ejemplo n.º 13
0
 public void CheckIfMonsterDied()
 {
     if (isMonster)
     {
         enemy = gameObject.GetComponent <EnemyInformation>();
         if (enemy.PlayerHealth < 0 && !(holder.GetComponent <KillQuest>().amountToKill >= holder.GetComponent <KillQuest>().maxAmount))
         {
             holder.GetComponent <KillQuest>().amountToKill += 1;
             GameObject temp = GameObject.FindGameObjectWithTag("QuestNotif");
             temp.GetComponent <Text>().text = holder.GetComponent <KillQuest>().amountToKill + " / " + holder.GetComponent <KillQuest>().maxAmount + " Left";
         }
     }
 }
Ejemplo n.º 14
0
    // använd för allt som inte rör sig
    void Update()
    {
        if (!MasterObject)
        {
            MasterObject = GameObject.Find("MasterObject");
        }
        else if (!eInfo)
        {
            eInfo = MasterObject.GetComponentInChildren <EnemyInformation>();
        }

        PlayerDefinedMovement();
        RotatePlayer();
    }
Ejemplo n.º 15
0
    public EnemyMovement(EnemyInformation enemyInfo, GameObject go)
    {
        this.enemyInfo        = enemyInfo;
        this.movementSpeed    = 0;
        this.MaxMovementSpeed = enemyInfo.MovementSpeed;
        this.anim             = go.GetComponent <Animator>();
        this.rigid            = go.GetComponent <Rigidbody2D>();
        this.transf           = go.GetComponent <Transform>();

        this.isWalking       = false;
        this.movementEnabled = true;
        this.onWall          = false;
        this.reduceMovement  = 100;
        this.direction       = new Vector2(0, -1);
    }
Ejemplo n.º 16
0
 void Update()
 {
     if (!ei)
     {
         GameObject go = GameObject.Find("MasterObject");
         if (go)
         {
             ei = go.GetComponentInChildren <EnemyInformation>();
             if (!ei)
             {
                 print("Why not found ");
             }
         }
     }
 }
Ejemplo n.º 17
0
    private void OnEnable()
    {
        character = target as CharacterInformation;
        enemy     = target as EnemyInformation;
        talker    = target as TalkerInformation;
        player    = target as PlayerInformation;
        if (talker)
        {
            allTalkers = Resources.LoadAll <TalkerInformation>("").ToList();
            allTalkers.Remove(talker);
        }
        _ID   = serializedObject.FindProperty("_ID");
        _Name = serializedObject.FindProperty("_Name");
        sex   = serializedObject.FindProperty("sex");

        lineHeight      = EditorGUIUtility.singleLineHeight;
        lineHeightSpace = lineHeight + 5;

        if (enemy)
        {
            dropItems = serializedObject.FindProperty("dropItems");
            HandlingDropItemList();
        }
        else if (talker)
        {
            defalutDialogue      = serializedObject.FindProperty("defaultDialogue");
            canDEV_RLAT          = serializedObject.FindProperty("canDEV_RLAT");
            favoriteItemDialogue = serializedObject.FindProperty("favoriteItemDialogue");
            normalItemDialogue   = serializedObject.FindProperty("normalItemDialogue");
            hateItemDialogue     = serializedObject.FindProperty("hateItemDialogue");
            favoriteItems        = serializedObject.FindProperty("favoriteItems");
            hateItems            = serializedObject.FindProperty("hateItems");
            canMarry             = serializedObject.FindProperty("canMarry");
            isWarehouseAgent     = serializedObject.FindProperty("isWarehouseAgent");
            isVendor             = serializedObject.FindProperty("isVendor");
            warehouse            = serializedObject.FindProperty("warehouse");
            shop         = serializedObject.FindProperty("shop");
            questsStored = serializedObject.FindProperty("questsStored");

            HandlingFavoriteItemList();
            HandlingHateItemList();
            HandlingQuestList();
        }
        else if (player)
        {
            backpack = serializedObject.FindProperty("backpack");
        }
    }
Ejemplo n.º 18
0
    public AI(EnemyInformation enemyInformation, GameObject enem, List <Ability> abs, EnemyMovement movemen)
    {
        player    = GameObject.FindWithTag("Player");
        enemyInfo = enemyInformation;
        enemy     = enem;
        abilities = abs;
        movement  = movemen;
        anim      = enemy.GetComponent <Animator>();

        attack    = new EnemyAttack(enem);
        inCombat  = false;
        canAttack = false;
        checkRate = .6f;
        timeStamp = Time.time + checkRate;
        state     = AIState.IDLE;
    }
Ejemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     delayForAttack = false;
     isRefreshed    = false;
     enemy          = gameObject.GetComponent <EnemyInformation>();
     baseEnemy      = gameObject.GetComponent <BaseEnemyScript>();
     //baseEnemy.CalculateEnemyInfo(2, 1);
     agent       = gameObject.GetComponent <NavMeshAgent>();
     player      = GameObject.FindGameObjectWithTag("Player");
     tele        = gameObject.GetComponent <TeleGrams>();
     isAttacking = false;
     orgLocation = Instantiate(new GameObject());
     orgLocation.transform.position = transform.position;
     isWaiting = false;
     orgPos    = projector.transform.localPosition;
 }
Ejemplo n.º 20
0
        public void setEnemyExplainPanel(EnemyInformation enemyInfo)
        {
            charName.text = enemyInfo.name;

            health.transform.GetChild(0).GetComponent <Text>().text = enemyInfo.health.ToString();

            damage.transform.GetChild(0).GetComponent <Text>().text = enemyInfo.damage.ToString();

            defense.transform.GetChild(0).GetComponent <Text>().text = enemyInfo.defense.ToString();

            weaponRange.transform.GetChild(0).GetComponent <Text>().text = enemyInfo.weaponRange.ToString();

            speed.transform.GetChild(0).GetComponent <Text>().text = enemyInfo.speed.ToString();

            criticalDamage.transform.GetChild(0).GetComponent <Text>().text = enemyInfo.criticalDamage.ToString();

            criticalRate.transform.GetChild(0).GetComponent <Text>().text = enemyInfo.criticalRate.ToString();
        }
Ejemplo n.º 21
0
 void Update()
 {
     if (!tagTransform)
     {
         tmpGO = GameObject.FindGameObjectWithTag(searchForTag);
         if (tmpGO)
         {
             tagTransform = tmpGO.transform;
         }
     }
     if (!MasterObject)
     {
         MasterObject = GameObject.Find("MasterObject");
     }
     else if (!eInfo)
     {
         eInfo = MasterObject.GetComponentInChildren <EnemyInformation>();
     }
 }
Ejemplo n.º 22
0
    public void NotifyComfirmKill(EnemyInformation enemyInformation)
    {
        if (this == null)
        {
            Debug.Log("THIS == null");
        }

        if (enemyInformation == null)
        {
            Debug.Log("enemyInformation == null");
        }

        if (OnKillTarget == null)
        {
            Debug.Log("OnKillTarget == null");
        }

        OnKillTarget(enemyInformation);
    }
Ejemplo n.º 23
0
    void Start () {
        myTransform = GetComponentInParent<Transform>();
        myParent = myTransform.parent;
        currentAttackCooldown = attackCooldown;

        aggro = false;

        foreach (Transform child in myParent)
        {
            if (child.name == "Mesh")
            {
                mesh = child;
            }
        }
        enemyInfo = mesh.GetComponent<Enemy>().GetEnemyInformation();
        enemyInfo.OnEnemyDeath += information_OnEnemyDeath;
        currentHealth = enemyInfo.Health;

        initialPosition = mesh.position;
	}
    public EnemyInformation GetEnemyInformation(string staticID)
    {
        foreach (EnemyInformation ei in allEnemys)
        {
            if (ei.StaticID == staticID)
            {
                EnemyInformation output = new EnemyInformation() { StaticID = staticID, Attack = ei.Attack, 
                    EnemyCard = ei.EnemyCard, ExpGained = ei.ExpGained, Health = ei.Health, MaxHealth = ei.MaxHealth, Name = ei.Name};   //vratimo kopiju

                int numberOfItems = UnityEngine.Random.Range(1, 3);
                for (int i = 0; i < numberOfItems; i++)
                {
                    output.DropLoot.Add(itemDatabase.GetRandomEquipment());
                }

                return output;
            }
        }
        return null;
    }
Ejemplo n.º 25
0
    public void makeEnemyJson()
    {
        enemies = new List <EnemyInformation>();

        EnemyInformation enemy = new EnemyInformation();

        enemy.characterID    = 0;
        enemy.name           = "카드병정1";
        enemy.level          = 1;
        enemy.health         = 100;
        enemy.damage         = 10;
        enemy.weaponRange    = 10;
        enemy.speed          = 5;
        enemy.defense        = 100;
        enemy.criticalRate   = 50;
        enemy.criticalDamage = 10;
        enemy.prefabID       = "3"; //Resource에 load할때는 "prefab_"+enemy.prefabID
        enemies.Add(enemy);

        EnemyInformation enemy2 = new EnemyInformation();

        enemy2.characterID    = 1;
        enemy2.name           = "카드병정2";
        enemy2.level          = 1;
        enemy2.health         = 100;
        enemy2.damage         = 20;
        enemy2.weaponRange    = 10;
        enemy2.speed          = 7;
        enemy2.defense        = 100;
        enemy2.criticalRate   = 50;
        enemy2.criticalDamage = 50;
        enemy2.prefabID       = "3"; //Resource에 load할때는 "prefab_"+enemy.prefabID
        enemies.Add(enemy2);

        string jdata = JsonConvert.SerializeObject(enemies);

        jdata = JValue.Parse(jdata).ToString(Formatting.Indented);
        File.WriteAllText(Application.dataPath + "/Resources/Json_GameInfo/EnemyInfo.json", jdata);

        AssetDatabase.Refresh();
    }
Ejemplo n.º 26
0
    void Update()
    {
        if (isReady)
        {
            if (!enemy && this.gameObject.tag == "Snail")
            {
                enemy = gameObject.GetComponent <EnemyInformation>();
            }

            /*if (this.gameObject.tag == "Snail" && enemy.PlayerHealth < 0 && !hasDied) <- this happends in enemy Information
             * {
             *  CheckIfMonsterDied();
             *  hasDied = true;
             * // Destroy(this.gameObject);
             * }*/
        }
        if (amountToKill > 0 && holder == this.gameObject && holder.GetComponent <KillQuest>().amountToKill == holder.GetComponent <KillQuest>().maxAmount&& !isCompleted)
        {
            holder.GetComponent <Interactions>().CompletedQuest();
            isCompleted = true;
        }
    }
Ejemplo n.º 27
0
        public void LoadMapFromXML(string mapName)
        {
            //Add map tiles
            this.TileSets.Add(new TileSet(baseGame, @"TileSheets\tileset1", 8, 8, 32, 32));
            this.TileSets.Add(new TileSet(baseGame, @"TileSheets\tileset2", 8, 8, 32, 32));

            //Add enemies
            for (int i = 0; i < 30; i++)
            {
                EnemyInformation e = new EnemyInformation("wizard", 100, 20);
                e.SpriteIdleDown = new SpriteSheet("SpriteSheets/Enemy/RedWizard/IdleDown", new Point(0, 0), new Point(50, 50), new Point(1, 1), SpriteDirection.Right);
                e.SpriteIdleUp = new SpriteSheet("SpriteSheets/Enemy/RedWizard/IdleUp", new Point(0, 0), new Point(50, 50), new Point(1, 1), SpriteDirection.Right);
                e.SpriteIdleRight = new SpriteSheet("SpriteSheets/Enemy/RedWizard/IdleRight", new Point(0, 0), new Point(50, 50), new Point(1, 1), SpriteDirection.Right);
                e.SpriteIdleLeft = new SpriteSheet("SpriteSheets/Enemy/RedWizard/IdleLeft", new Point(0, 0), new Point(50, 50), new Point(1, 1), SpriteDirection.Right);
                e.SpriteWalk = new SpriteSheet("SpriteSheets/Enemy/RedWizard/Walk", new Point(0, 0), new Point(50, 50), new Point(2, 1), SpriteDirection.Right);
                e.SpriteWalkUp = new SpriteSheet("SpriteSheets/Enemy/RedWizard/WalkUp", new Point(0, 0), new Point(50, 50), new Point(2, 1), SpriteDirection.Right);
                e.SpriteWalkDown = new SpriteSheet("SpriteSheets/Enemy/RedWizard/WalkDown", new Point(0, 0), new Point(50, 50), new Point(2, 1), SpriteDirection.Right);
                Enemies.Add(e);
            }

            //Add bosses here
            //Add number of enemies here
        }
Ejemplo n.º 28
0
 public void NotifyKillEnemy(EnemyInformation killedEnemyInformation)
 {
     OnKillEnemy(killedEnemyInformation);
 }
Ejemplo n.º 29
0
    //ENEMY INFORMATION HANDLERS

    void playerCombat_OnTargetFocusChanged(EnemyInformation info)
    {
        myCanvas.transform.Find("infoEnemyPanel/txtEnemyName").GetComponent<Text>().text = info.Name;
        string health = info.Health + " / " + info.MaxHealth;
        myCanvas.transform.Find("infoEnemyPanel/txtEnemyHealth").GetComponent<Text>().text = health;
        myCanvas.transform.Find("infoEnemyPanel/txtEnemyAttack").GetComponent<Text>().text = info.Attack.ToString();
    }
Ejemplo n.º 30
0
 void playerCombat_OnTargetHealthChanged(EnemyInformation info)
 {
     SetHealthOnHeatlhtBar(info);
 }
Ejemplo n.º 31
0
 public void SetAsteroidInformation(EnemyInformation cachedEnemyInformation)
 {
     CachedEnemyInformation = cachedEnemyInformation;
 }
Ejemplo n.º 32
0
 void information_OnEnemyDeath(EnemyInformation information)
 {
     Debug.Log("Neprijatelj je umro: " + information.IdEnemy);
     CurrentPlayer.currentPlayer.Experience += information.ExpGained;
     OnExperienceGained();
 }
Ejemplo n.º 33
0
    /// <summary>
    /// 1 is mage, 2 is warrior, 3 is Enhancer, 4 is paladin, 5 is Priest, and 6 is archer
    /// </summary>
    /// <param name="enemyClassNum"></param>
    ///
    void CalculateEnemyInfo(int enemyClassNum)
    {
        enemyInfo    = gameObject.GetComponent <EnemyInformation>();
        newEnemy     = new BasePlayer();
        calculations = new StatCalculations();
        name         = gameObject.name;
        int number = enemyClassNum;

        if (number == 1)
        {
            enemyInfo.PlayerClass = new BaseMageClass();
            enemyInfo.MainStat    = enemyInfo.Intellect;
        }
        else if (number == 2)
        {
            enemyInfo.PlayerClass = new BaseWarriorClass();
            enemyInfo.MainStat    = enemyInfo.Strength;
        }
        else if (number == 3)
        {
            enemyInfo.PlayerClass = new BaseEnhancerClass();
            enemyInfo.MainStat    = enemyInfo.Agility;
        }
        else if (number == 4)
        {
            enemyInfo.PlayerClass = new BasePaladinClass();
            enemyInfo.MainStat    = enemyInfo.Endurance;
        }
        else if (number == 5)
        {
            enemyInfo.PlayerClass = new BasePriestClass();
            enemyInfo.MainStat    = enemyInfo.Mastery;
        }
        else if (number == 6)
        {
            enemyInfo.PlayerClass = new BaseArcherClass();
            enemyInfo.MainStat    = enemyInfo.Agility;
        }
        //MAKE SURE TO CREATE A NEW INSTANCE OF THIS FOR EVERY ENEMY/BOSS ETC.
        // HAve to add it to all the enemies in and playtest it
        // We are going to learn about networking soon.
        enemyInfo.PlayerLevel = 20; // <- Dynamically from enemy scripts
        stamina    = enemyInfo.PlayerClass.Stamina * (enemyInfo.PlayerLevel / 2);
        intellect  = enemyInfo.PlayerClass.Intellect * (enemyInfo.PlayerLevel / 2);
        strength   = enemyInfo.PlayerClass.Strength * (enemyInfo.PlayerLevel / 2);
        endurance  = enemyInfo.PlayerClass.Endurance * (enemyInfo.PlayerLevel / 2);
        agility    = enemyInfo.PlayerClass.Agility * (enemyInfo.PlayerLevel / 2);
        mastery    = enemyInfo.PlayerClass.Mastery * (enemyInfo.PlayerLevel / 2);
        resistance = enemyInfo.PlayerClass.Resistance;
        SetEnemyInfo();
        if (number == 1)
        {
            enemyInfo.MainStat = enemyInfo.Intellect;
        }
        else if (number == 2)
        {
            enemyInfo.MainStat = enemyInfo.Strength;
        }
        else if (number == 3)
        {
            enemyInfo.MainStat = enemyInfo.Agility;
        }
        else if (number == 4)
        {
            enemyInfo.MainStat = enemyInfo.Endurance;
        }
        else if (number == 5)
        {
            enemyInfo.MainStat = enemyInfo.Mastery;
        }
        else if (number == 6)
        {
            enemyInfo.MainStat = enemyInfo.Agility;
        }

        enemyInfo.PlayerMaxHealth = calculations.CalculateHealth(enemyInfo.Endurance);
        enemyInfo.PlayerMaxEnergy = calculations.CalculateEnergy(enemyInfo.Intellect);
        enemyInfo.PlayerHealth    = enemyInfo.PlayerMaxHealth;
        enemyInfo.PlayerEnergy    = enemyInfo.PlayerMaxEnergy;

        calculated = true;
        Debug.Log(calculated);
    }
Ejemplo n.º 34
0
 void Start()
 {
     enemyScript = this.gameObject.GetComponent <Enemy>();
     enemyInfo   = enemyScript.EnemyInfo;
 }
Ejemplo n.º 35
0
 public virtual void Awake()
 {
     headQuater = GameObject.FindGameObjectWithTag("MainBuilding");
     myInfo = GetComponent<EnemyInformation>();
 }
Ejemplo n.º 36
0
	// Use this for initialization
	void Awake () {
        IEnemyDatabase enemyDatabase = Repository.GetEnemyDatabaseInstance();
        information = enemyDatabase.GetEnemyInformation(staticID);
	}
Ejemplo n.º 37
0
 // Use this for initialization
 void Start()
 {
     ei = GetComponent<EnemyInformation>();
     cam = GameObject.Find("CameraCombat").camera;
 }
Ejemplo n.º 38
0
 void information_OnEnemyDeath(EnemyInformation information)
 {
     Transform particles = myParent.Find("Particles");
     particles.gameObject.SetActive(true);
     gameObject.SetActive(false);
 }