public BattleAbilityUseHandler(ref BaseCharacterClass character, int playerTargetIndex, ref BaseCharacterClass[] alliedCharacters, ref BaseEnemy[] enemies)
 {
     this.character = character;
     this.playerTargetIndex = playerTargetIndex;
     this.alliedCharacters = alliedCharacters;
     this.enemies = enemies;
 }
Exemplo n.º 2
0
    void Awake()
    {
        detector = gameObject.GetComponent<RangeDetector> ();
        detector.range = 2;

        character = detector.target.transform.GetComponent<BaseCharacterClass>();
    }
Exemplo n.º 3
0
 /*
     For testing purposes. Attacks the unit with highest presence
 */
 public static Entity biggestPresenceStrategy(BaseCharacterClass[] characters, BaseEnemy[] enemies)
 {
     BaseCharacterClass target = characters[0];
     for (int i = 1; i < characters.Length; i++)
     {
         if (target.presence < characters[i].presence)
         {
             target = characters[i];
         }
     }
     return target;
 }
Exemplo n.º 4
0
    public void PrepareBattle3()
    {
        TurnBasedCombatStateMachine.turnCount = 1;
        //create enemy
        Enemy1 = CreateMeleeEnemy();
        Enemy2 = CreateHealerEnemy();
        Enemy3 = CreateHealerEnemy();
        //apply buffs or specs here

        //Who's turn?
        TurnBasedCombatStateMachine.currentState = TurnBasedCombatStateMachine.BattleStates.PLAYERCHOICE;
    }
    private void RetrieveBaseStatPoints()
    {
        BaseCharacterClass characterClass = GameInformation.PlayerClass;

        pointsToAllocate[0] = characterClass.Rhetoric;
        baseStatPoints[0]   = characterClass.Rhetoric;

        pointsToAllocate[1] = characterClass.Image;
        baseStatPoints[1]   = characterClass.Image;

        pointsToAllocate[2] = characterClass.Diplomacy;
        baseStatPoints[2]   = characterClass.Diplomacy;
    }
Exemplo n.º 6
0
    public static bool RunAwayFromCombat(BaseCharacterClass player, BaseCharacterClass enemy)
    {
        bool isRunningAwayFromCombat = false;

        if ((player.agility * Random.Range(MinMaxRandomEscape.x, MinMaxRandomEscape.y)) < (enemy.agility * Random.Range(MinMaxRandomEscape.x, MinMaxRandomEscape.y) * EnemyNerfValueForEscape)) //Agil
        {
            isRunningAwayFromCombat = true;
        }



        return(isRunningAwayFromCombat);
    }
Exemplo n.º 7
0
    public void LoadPlayer(string player)
    {
        LoadStats(player);
        transform.GetComponent<Animator>().SetBool("death", false);
        LoadScale();

        if (character == "Warrior")
        {
            playerClass = new BaseWarriorClass();
        }

        pause = 0;
    }
    // Left Button Function - Display Previous Character
    public void LeftButton()
    {
        currentIndex--;

        // Prevent Array out of bound
        if (currentIndex < 0)
        {
            currentIndex = 0;
        }

        currentCharacter.overrideSprite = characterSprites [currentIndex];
        currentClass = classDatabase.GetClass(currentIndex);
        DisplayStat();
    }
    // Right Button Function - Display Next Character
    public void RightButton()
    {
        currentIndex++;

        // Prevent Array out of Bound
        if (currentIndex >= characterSprites.Length)
        {
            currentIndex = characterSprites.Length - 1;
        }

        currentCharacter.overrideSprite = characterSprites [currentIndex];
        currentClass = classDatabase.GetClass(currentIndex);
        DisplayStat();
    }
Exemplo n.º 10
0
 public static void ApplyDoping(BaseCharacterClass target)
 {
     if (target.Buffed == 0)
     {
         target.IsDoping     = true;
         target.Buffed       = 3;
         target.Defense      = (float)Math.Ceiling(target.Defense *= target.ability3.multiplier);
         target.Magicdefense = (float)Math.Ceiling(target.Magicdefense *= target.ability3.multiplier);
         target.MaxHealth   += 10;
     }
     else if (target.Buffed > 0)
     {
         target.Buffed = 3;
     }
 }
Exemplo n.º 11
0
 public void Init(int enemyType)
 {
     if (enemyType == orc)
     {
         bcc = new Orc();
     }
     else if (enemyType == elemental)
     {
         bcc = new Elemental();
     }
     else
     {
         bcc = new Boss();
     }
 }
Exemplo n.º 12
0
    private void RetrieveStatBaseStatPoints()
    {
        BaseCharacterClass cClass = GameInformation.PlayerClass;

        pointsToAllocate[0] = cClass.Strength;
        baseStatPoints[0]   = cClass.Strength;
        pointsToAllocate[1] = cClass.Dexterity;
        baseStatPoints[1]   = cClass.Dexterity;
        pointsToAllocate[2] = cClass.Intellegence;
        baseStatPoints[2]   = cClass.Intellegence;
        pointsToAllocate[3] = cClass.Charisma;
        baseStatPoints[3]   = cClass.Charisma;
        pointsToAllocate[4] = cClass.Luck;
        baseStatPoints[4]   = cClass.Luck;
    }
 // Confirm Button Function - Confirm Player's Character Selection
 public void SelectCharacter()
 {
     selectClass     = currentClass;
     pm._playerName  = playerName.text;
     pm._playerClass = selectClass.ClassName;
     pm._playerLevel = 0;
     pm._playerExp   = 0;
     pm._playerHP    = 10;
     pm._playerVit   = selectClass.Vitality;
     pm._playerStr   = selectClass.Strength;
     pm._playerDef   = selectClass.Defense;
     pm._playerLuck  = selectClass.Luck;
     pm._playerPosX  = 0;
     pm._playerPosY  = 0;
     pm._playerPosZ  = 0;
 }
Exemplo n.º 14
0
    private void RetrieveBaseStatPoints()
    {
        BaseCharacterClass cClass = GameInformation.PlayerClass;

        pointsToAllocate [0] = cClass.Stamina;
        baseStatPoints [0]   = cClass.Stamina;

        pointsToAllocate [1] = cClass.Endurance;
        baseStatPoints [1]   = cClass.Endurance;

        pointsToAllocate [2] = cClass.Intellect;
        baseStatPoints [2]   = cClass.Intellect;

        pointsToAllocate [3] = cClass.Strength;
        baseStatPoints [3]   = cClass.Strength;
    }
Exemplo n.º 15
0
    public BaseCharacterClass ChargerPlayer(BaseCharacterClass player)
    {
        player.characterClass = OmniPlayer.Instance.characterClass;
        player.characterLevel = OmniPlayer.Instance.characterLevel;
        player.experience     = OmniPlayer.Instance.experience;
        player.maxExperience  = OmniPlayer.Instance.maxExperience;
        player.strenght       = OmniPlayer.Instance.strenght;
        player.endurance      = OmniPlayer.Instance.endurance;
        player.intelligence   = OmniPlayer.Instance.intelligence;
        player.agility        = OmniPlayer.Instance.agility;
        player.currentHP      = OmniPlayer.Instance.currentHP;
        player.maxHP          = OmniPlayer.Instance.maxHP;
        player.currentMana    = OmniPlayer.Instance.currentMana;
        player.maxMana        = OmniPlayer.Instance.maxMana;

        return(player);
    }
Exemplo n.º 16
0
 void incrementAllyHealth()
 {
     foreach (PartyLayout ally in gameLoop.partyManager.listOfAllies)
     {
         BaseCharacterClass currentChar = ally.friendlyPrefab.GetComponent <BaseCharacterClass>();
         List <string>      keys        = new List <string>(battleSystemRef.healthManager.Keys);
         foreach (string key in keys)
         {
             if (currentChar.CharacterClassName == key)
             {
                 battleSystemRef.healthManager[key] = battleSystemRef.healthManager[key] + healthRestore;
                 if (battleSystemRef.healthManager[key] >= currentChar.MaxHealth)
                 {
                     battleSystemRef.healthManager[key] = currentChar.MaxHealth;
                 }
             }
         }
     }
 }
Exemplo n.º 17
0
    //dohvata poene za odredjenu klasu i upisuje ih u niz koji se zatim prikazuje na  guiu i pravi niz koji cemo da editujemo i cuvamo u bazi
    private void RetrieveStatBaseStatPoints()
    {
        BaseCharacterClass cClass = GameInformation.PlayerClass;

        pointsToAllcoate [0] = cClass.Stamina;
        baseStatPoints [0]   = cClass.Stamina;
        pointsToAllcoate [1] = cClass.Endurance;
        baseStatPoints [1]   = cClass.Endurance;
        pointsToAllcoate [2] = cClass.Strenght;
        baseStatPoints [2]   = cClass.Strenght;
        pointsToAllcoate [3] = cClass.Agility;
        baseStatPoints [3]   = cClass.Agility;
        pointsToAllcoate [4] = cClass.Intelect;
        baseStatPoints [4]   = cClass.Intelect;
        pointsToAllcoate [5] = cClass.Resistance;
        baseStatPoints [5]   = cClass.Resistance;
        pointsToAllcoate [6] = cClass.MagicResistance;
        baseStatPoints [6]   = cClass.MagicResistance;
    }
Exemplo n.º 18
0
    public static void RemoveDivineLight(BaseCharacterClass target1, BaseCharacterClass target2, BaseCharacterClass target3)
    {
        if (target1.BuffedH == 0 && target1.IsDivLit)
        {
            target1.IsDivLit     = false;
            target1.Defense      = (float)Math.Ceiling(target1.Defense /= PlayerParty.Healer.ability4.multiplier);
            target1.Magicdefense = (float)Math.Ceiling(target1.Magicdefense /= PlayerParty.Healer.ability4.multiplier);
            target1.MaxHealth   -= 5;

            target2.IsDivLit     = false;
            target2.Defense      = (float)Math.Ceiling(target2.Defense /= PlayerParty.Healer.ability4.multiplier);
            target2.Magicdefense = (float)Math.Ceiling(target2.Magicdefense /= PlayerParty.Healer.ability4.multiplier);
            target2.MaxHealth   -= 5;

            target3.IsDivLit     = false;
            target3.Defense      = (float)Math.Ceiling(target3.Defense /= PlayerParty.Healer.ability4.multiplier);
            target3.Magicdefense = (float)Math.Ceiling(target3.Magicdefense /= PlayerParty.Healer.ability4.multiplier);
            target3.MaxHealth   -= 5;
        }
    }
Exemplo n.º 19
0
    /*
        Attacks based on presence
    */
    public static Entity purePresenceStrategy(BaseCharacterClass[] characters, BaseEnemy[] enemies)
    {
        int totalPresence = 0;
        foreach (BaseCharacterClass c in characters) {
            totalPresence += c.presence;
        }

        int random = Random.Range(0, totalPresence);
        int presenceAccumulator = 0;
        foreach (BaseCharacterClass c in characters)
        {
            int characterPresence = c.presence;
            if (random <= characterPresence + presenceAccumulator)
            {
                return c;
            }
            presenceAccumulator += characterPresence;
        }
        // Should never reach this case!
        return null;
    }
Exemplo n.º 20
0
    public static float Attack(BaseCharacterClass attacker, BaseCharacterClass defender)
    {
        float      damageDealt = 0;
        AttackType atkType;

        if (!EvadeAttack())
        {
            atkType = (attacker.isPhysicalAttacker) ? AttackType.Physical : AttackType.Magic;


            if (atkType == AttackType.Physical)
            {
                if (CriticalHit())
                {
                    damageDealt = (attacker.strenght - defender.endurance) * CritRatio;
                }
                else
                {
                    damageDealt = (attacker.strenght - defender.endurance);
                }
            }
            else
            {
                if (CriticalHit())
                {
                    damageDealt = (attacker.intelligence - defender.intelligence) * CritRatio;
                }
                else
                {
                    damageDealt = (attacker.intelligence - defender.intelligence);
                }
            }
        }
        if (damageDealt < 0)
        {
            damageDealt = 0;
        }

        return(damageDealt);
    }
Exemplo n.º 21
0
    public CharClass(characterClass thisClass)
    {
        switch (thisClass)
        {
        case characterClass.WARRIOR:
            Statistics       = new BaseCharacterClass(BaseCharacterClass.mainStat.STR_MAIN);
            className        = "Warrior";
            classDescription = "A very strong character that uses brute force to fight enemies";
            break;

        case characterClass.MAGE:
            Statistics       = new BaseCharacterClass(BaseCharacterClass.mainStat.INT_MAIN);
            className        = "Mage";
            classDescription = "Physically weak character that can cast powerful spells";
            break;

        case characterClass.ARCHER:
            Statistics       = new BaseCharacterClass(BaseCharacterClass.mainStat.AGI_MAIN);
            className        = "Archer";
            classDescription = "Very agile character that shots enemies with bow and arrows";
            break;
        }
    }
    private void RetrieveStatBaseStatPoints()
    {
        BaseCharacterClass cClass = GameInformation.PlayerClass;

        pointsToAllocate [0] = cClass.Stamina;
        pointsToAllocate [1] = cClass.Endurance;
        pointsToAllocate [2] = cClass.Intellect;
        pointsToAllocate [3] = cClass.Strength;
        pointsToAllocate [4] = cClass.Overpower;
        pointsToAllocate [5] = cClass.Luck;
        pointsToAllocate [6] = cClass.Mastery;
        pointsToAllocate [7] = cClass.Charisma;


        baseStatPoints [0] = cClass.Stamina;
        baseStatPoints [1] = cClass.Endurance;
        baseStatPoints [2] = cClass.Intellect;
        baseStatPoints [3] = cClass.Strength;
        baseStatPoints [4] = cClass.Overpower;
        baseStatPoints [5] = cClass.Luck;
        baseStatPoints [6] = cClass.Mastery;
        baseStatPoints [7] = cClass.Charisma;
    }
Exemplo n.º 23
0
    public static void ApplyDivineLight(BaseCharacterClass target1, BaseCharacterClass target2, BaseCharacterClass target3)
    {
        if ((target1.BuffedH == 0) && (target2.BuffedH == 0) && (target3.BuffedH == 0))
        {
            target1.BuffedH  = target2.BuffedH = target3.BuffedH = 3;
            target1.IsDivLit = target2.IsDivLit = target3.IsDivLit = true;

            target1.Defense      = (float)Math.Ceiling(target1.Defense *= PlayerParty.Healer.ability4.multiplier);
            target1.Magicdefense = (float)Math.Ceiling(target1.Magicdefense *= PlayerParty.Healer.ability4.multiplier);
            target1.MaxHealth   += 5;

            target2.Defense      = (float)Math.Ceiling(target2.Defense *= PlayerParty.Healer.ability4.multiplier);
            target2.Magicdefense = (float)Math.Ceiling(target2.Magicdefense *= PlayerParty.Healer.ability4.multiplier);
            target2.MaxHealth   += 5;

            target3.Defense      = (float)Math.Ceiling(target3.Defense *= PlayerParty.Healer.ability4.multiplier);
            target3.Magicdefense = (float)Math.Ceiling(target3.Magicdefense *= PlayerParty.Healer.ability4.multiplier);
            target3.MaxHealth   += 5;
        }
        else if (target1.BuffedH > 0)
        {
            target1.BuffedH = target2.BuffedH = target3.BuffedH = 3;
        }
    }
Exemplo n.º 24
0
 public void Init()
 {
     inputManager = new InputManager();
     rb2D         = GetComponent <Rigidbody2D>();
     anim         = GetComponent <Animator>();
     //classe du player selon le choix .... pour linstant 1 = guerrier, 2 = mage;
     if (OmniPlayer.Instance.characterLevel != 0) //get previous scene data
     {
         bcc = new BaseCharacterClass();
         bcc.characterClass            = OmniPlayer.Instance.characterClass;
         bcc.characterLevel            = OmniPlayer.Instance.characterLevel;
         bcc.experience                = OmniPlayer.Instance.experience;
         bcc.maxExperience             = OmniPlayer.Instance.maxExperience;
         bcc.strenght                  = OmniPlayer.Instance.strenght;
         bcc.endurance                 = OmniPlayer.Instance.endurance;
         bcc.intelligence              = OmniPlayer.Instance.intelligence;
         bcc.agility                   = OmniPlayer.Instance.agility;
         bcc.currentHP                 = OmniPlayer.Instance.currentHP;
         bcc.maxHP                     = OmniPlayer.Instance.maxHP;
         bcc.currentMana               = OmniPlayer.Instance.currentMana;
         bcc.maxMana                   = OmniPlayer.Instance.maxMana;
         gameObject.transform.position = OmniPlayer.Instance.position;
     }
     else
     {
         if (isWarrior)
         {
             bcc = new Warrior();
         }
         else
         {
             bcc = new Wizard();
         }
     }
     SavePlayer();
 }
Exemplo n.º 25
0
 // Add any amount of exp
 public void GiveExpToCharacter(int exp, BaseCharacterClass character)
 {
     character.level.AddExp(exp);
 }
Exemplo n.º 26
0
 // Add any amount of exp
 public void GiveExpToCharacter(int exp, BaseCharacterClass character)
 {
     character.level.AddExp (exp);
 }
Exemplo n.º 27
0
 // use the difference in the level, any buffs, states, or other
 // parameters to calculate the exp to give the killer based on
 // the variable value.
 public void KillExpToGive(BaseCharacterClass killed, BaseCharacterClass killer)
 {
     float percent = (float)killed.level.level / killer.level.level;
     int exp = (int)(value * percent);
     killer.level.AddExp(exp);
 }
 public void TakeDamageFromCharacter([NotNull] BaseCharacterClass baseCharacter)
 {
     CurrentHealth -= (int)baseCharacter.BaseStats.Power;        
     if (CurrentHealth <= 0)
         isDead = true;
 }
Exemplo n.º 29
0
 /*
 Changes the text of the UI to reflect the current character abilities and overall items.
 It also updates the text to show possible targets.
 */
 public void personaliseMenuToCharacter(BaseCharacterClass c)
 {
     this.allyTurnReady = c;
     characterName.text = allyTurnReady.getName();
     changeMenuText();
 }
Exemplo n.º 30
0
 void Awake()
 {
     player = gameObject.GetComponent<BaseCharacterClass> ();
 }
Exemplo n.º 31
0
 private BaseAbility ChooseHealerEnemyAbility(BaseCharacterClass enemy)
 {
     return(enemy.ability2);
 }
Exemplo n.º 32
0
 //battle 2
 private void EnemyAction(BaseCharacterClass Enemy1, BaseCharacterClass Enemy2, BaseCharacterClass Enemy3)
 {
     //ability
     //damage
     //end
 }
Exemplo n.º 33
0
 public Game()
 {
     knight = new BaseCharacterClass();
     rogue  = new BaseCharacterClass();
     wizard = new BaseCharacterClass();
 }
 void MageClicked()
 {
     createdCharacter = new BaseMageClass();
     UpdateCharacterDetailsView();
 }
 public void RestoreHealth(BaseCharacterClass bs)
 {
     CurrentHealth += (int)bs.BaseStats.Power;
 }
 // ...
 public void SetModel(BaseCharacterClass chr)
 {
     healthText.text = chr.Health.ToString();
     manaText.text   = chr.Mana.ToString();
     // ...
 }
Exemplo n.º 37
0
 void Awake()
 {
     player = gameObject.GetComponent <BaseCharacterClass> ();
 }
Exemplo n.º 38
0
 private void checkIfAllyTurnReadyIsDead()
 {
     if (allyTurnReady != null && allyTurnReady.isDead())
     {
         this.allyTurnReady = null;
     }
 }
Exemplo n.º 39
0
 /*
     Simplest of strategies, attacks a random character.
 */
 public static Entity randomStrategy(BaseCharacterClass[] characters, BaseEnemy[] enemies)
 {
     return characters[Random.Range(0, characters.Length - 1)];
 }
Exemplo n.º 40
0
	/* Update is called once per frame
       The function works like this:
            - The turnQueue is queried to see if someone's turn should begin
            - Depending on the state of the battle, a turn is executed, nothing happens...etc
            - Finally, the waiting times are updated according to Time.Delta
    */
	void Update () {
        //The current battle state determines what actions can be taken.
        checkForTurn();
        checkEndOfBattle();
	    switch(currentState)
        {
            case BattleState.START:
                // Start of the battle.
                UIStateController.Instance.enableMenu("waiting");
                UIStateController.Instance.updateCharacterAndEnemiesText();
                currentState = BattleState.WAITING;
                break;
            case BattleState.WAITING:
                // Idle phase, nothing happens.
                /* DIFFERENTS EFFECTS COUlD BE APPLIED:
                        - Check if buffs / debuffs end (speed up, poison...)
                        - Apply effects such as poison
                        - Regeneration (Perhaps armor fell off and is being regenerated)
                */
                break;
            case BattleState.PLAYERTURN:
                // Player turn starts and 
                // Start GUI showing the "initial" menu state.
                if (allyTurnReady == null)
                {
                    QueuedEntity allyqe = turnQueue.Dequeue();
                    allyTurnReady = (BaseCharacterClass)allyqe.entity;
                    UIStateController.Instance.enableMenu("initial");
                    UIStateController.Instance.personaliseMenuToCharacter(allyTurnReady);
                }
                
                currentState = BattleState.WAITING;
                break;
            case BattleState.ENEMYTURN:
                // Enemy's turn starts
                QueuedEntity enemyqe = turnQueue.Dequeue();
                BaseEnemy enemy = (BaseEnemy)enemyqe.entity;

                // To ensure that dead units are not targeted, filter them out.
                Entity target   = enemy.strategy(Array.FindAll(alliedCharacters, e => !e.isDead()),
                                                 Array.FindAll(enemies, e => !e.isDead()));


                Debug.Log(enemy.getName() + " Attacks " + target.getName() + " for " + enemy.attack + " damage");
                target.takeDamage(enemy.attack);

                turnQueue.Enqueue(new QueuedEntity(enemy), enemy.speed);
                UIStateController.Instance.updateCharacterAndEnemiesText();
                currentState = BattleState.WAITING;
                break;
            case BattleState.CALCDAMAGE:
                // Calculates dmg to target(s)
                BattleAbilityUseHandler abilityHandler = new BattleAbilityUseHandler(ref allyTurnReady, playerTargetIndex,
                                                                                      ref alliedCharacters, ref enemies);
                abilityHandler.calculateDamage();
                int castingTIme = abilityHandler.calculateCastingTime();
                this.playerTargetIndex = -1;

                turnQueue.Enqueue(new QueuedEntity(allyTurnReady), castingTIme);
                this.allyTurnReady = null;
                currentState = BattleState.WAITING;
                UIStateController.Instance.updateCharacterAndEnemiesText();
                break;
            case BattleState.ADDSTATUSEFFECT:
                // Adds special status such as poison.
                break;
            case BattleState.WIN:
                /* All enemies have been defeated, we store the relevant information in GameInformation
                   and we get back to the map */
                //GameInformation.alliedCharacters = alliedCharacters;
                Debug.Log("GAME WON");
                break;
            case BattleState.LOSE:
                // All allied characters have been defeated.
                Debug.Log("GAME LOST");
                break;
            default:
                break;
        }
        // If it's a character's turn, check if he / she has died
        checkIfAllyTurnReadyIsDead();



        // Update the turnque in order to reflect time passing.
        updateTurnQueue(Time.deltaTime);

    }
Exemplo n.º 41
0
    public void Initialize()
    {
        uiActionContainer = CombatFlow.cl.uiActionContainer;

        //utilisation du viewport de la camera pour placer les characters
        playerStartingPosition = CombatFlow.cl.camera.ViewportToWorldPoint(new Vector2(.2f, .5f));
        ennemiStartingPosition = CombatFlow.cl.camera.ViewportToWorldPoint(new Vector2(.8f, .5f));

        playerHp   = CombatFlow.cl.playerHp;             //pointeur vers le composant text des HP du joueur
        playerMana = CombatFlow.cl.playerMana;           //pointeur vers le composant text de la mana du joueur
        ennemiHP   = CombatFlow.cl.ennemiHP;             //pointeur vers le composant text des HP de l'ennemi
        ennemiMana = CombatFlow.cl.ennemiMana;           //pointeur vers le composant text de la mana de l'ennemi

        playerHpImage   = CombatFlow.cl.playerHpImage;   //pointeur vers le composant image des HP du joueur
        playerManaImage = CombatFlow.cl.playerManaImage; //pointeur vers le composant image de la mana du joueur
        ennemiHPImage   = CombatFlow.cl.ennemiHPImage;   //pointeur vers le composant image des HP de l'ennemi
        ennemiManaImage = CombatFlow.cl.ennemiManaImage; //pointeur vers le composant image de la mana de l'ennemi
        playerImage     = CombatFlow.cl.playerImage;     //pointeur vers le composant image du portrait du joueur
        ennemiImage     = CombatFlow.cl.ennemiImage;     //pointeur vers le composant image du portrait de l'ennemi

        switch (OmniPlayer.Instance.characterClass)
        {
        case CharacterClasses.Warrior:
            player             = new Warrior();
            playerImage.sprite = GameObject.Instantiate <Sprite>(Resources.Load <Sprite>("Sprites/Gladiator_Portrait"));
            playerObj          = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Warrior"));
            break;

        case CharacterClasses.Wizard:
            player             = new Wizard();
            playerImage.sprite = GameObject.Instantiate <Sprite>(Resources.Load <Sprite>("Sprites/Wizards_Portrait"));
            playerObj          = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Wizard"));
            break;

        default:
            Debug.Log("Unhandeled character class : " + player.characterClass);
            break;
        }
        CombatFlow.cl.PlayerCharacter = ChargerPlayer(player);

        switch (OmniEnemy.Instance.characterClass)
        {
        case CharacterClasses.Orc:
            ennemi             = new Orc();
            ennemiImage.sprite = GameObject.Instantiate <Sprite>(Resources.Load <Sprite>("Sprites/Orc_Portrait"));
            ennemiObj          = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Orc"));
            break;

        case CharacterClasses.Elemental:
            ennemi             = new Elemental();
            ennemiImage.sprite = GameObject.Instantiate <Sprite>(Resources.Load <Sprite>("Sprites/Elemental_Portrait"));
            ennemiObj          = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Elemental"));
            break;

        case CharacterClasses.Boss:
            ennemi             = new Boss();
            ennemiImage.sprite = GameObject.Instantiate <Sprite>(Resources.Load <Sprite>("Sprites/Golem_Portrait"));
            ennemiObj          = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Boss"));
            break;

        default:
            Debug.Log("Unhandeled character class : " + player.characterClass);
            break;
        }
        CombatFlow.cl.EnemyCharacter = ennemi;


        playerObj.transform.position    = CombatFlow.cl.playerPosition = playerStartingPosition;
        playerObj.transform.localScale *= CHARACTER_SIZE;
        playerAnimator = playerObj.GetComponent <Animator>();

        ennemiObj.transform.position    = ennemiStartingPosition;
        ennemiObj.transform.localScale *= CHARACTER_SIZE;
        ennemiAnimator = ennemiObj.GetComponent <Animator>();

        playerEffect = playerObj.GetComponentsInChildren <ParticleSystem>();
        ennemiEffect = playerObj.GetComponentsInChildren <ParticleSystem>();
    }
 // ...
 void WarriorClicked()
 {
     createdCharacter = new BaseWarriorClass();
     UpdateCharacterDetailsView();
 }