Пример #1
0
    private EnemySkills generateSkillNormal()
    {
        EnemySkills chosenSkill = null;

        changeWeightsOfAttacksNormal();

        int skillValue = normalAttackWeights.generateSkillSelectorValue();

        switch (skillValue)
        {
        case 0:
            chosenSkill = new ColumnAttack(4, enemy);
            break;

        case 1:
            chosenSkill = new RowAttack(4, enemy);
            break;

        case 2:
            chosenSkill = new RandomAttack(4, enemy, 2);
            break;

        case 3:
            chosenSkill = new ColumnProjectileAttack(3, enemy);
            break;
        }

        normalAttackWeights.resetWeightsOfAttacks();

        return(chosenSkill);
    }
Пример #2
0
 public new void Update(SQLiteConnection conn)
 {
     base.Update(conn);
     EnemySkills.Update(conn);
     EnemyWeapons.Update(conn);
     EnemyItems.Update(conn);
 }
Пример #3
0
        public Spell GetEnemySkill(string id)
        {
            if (!EnemySkills.ContainsKey(id))
            {
                throw new GameDataException("Could not find enemy skill with id " + id);
            }

            return(EnemySkills[id]);
        }
Пример #4
0
    void OnTriggerEnter2D(Collider2D hit)
    {
        EnemySkills enemy = hit.GetComponent <EnemySkills>();

        if (enemy != null)
        {
            enemy.TakeDamage(damage);
            Destroy(this.gameObject);
        }
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        attackIsDone = false;
        chargeCount  = 0;
        currentSkill = null;

        parentObj   = this.gameObject;
        enemyScript = gameObject.GetComponent <Enemy>();

        skillDecider = new EnemySkillDecider(parentObj.transform.parent.gameObject);
    }
Пример #6
0
 protected override void OnRead(SQLiteDataReader reader)
 {
     EnemyInput.SelectedIndex         = EnemyData.FindIndex(reader["EnemyID"]);
     LevelInput.Text                  = reader["Level"].ToString();
     GridPositionZInput.SelectedIndex = int.Parse(reader["GridPositionZ"].ToString());
     GridPositionXInput.SelectedIndex = int.Parse(reader["GridPositionX"].ToString());
     HPMultiplierInput.Text           = reader["HPMultiplier"].ToString();
     EnemySkills.Read();
     EnemyWeapons.Read();
     EnemyItems.Read();
     PassiveSkill1Input.SelectedIndex = PassiveSkillData.FindIndex(reader["PassiveSkill1"]);
     PassiveSkill2Input.SelectedIndex = PassiveSkillData.FindIndex(reader["PassiveSkill2"]);
 }
Пример #7
0
    private void Start()
    {
        player           = PlayerManager.instance.player;
        playerAnimator   = player.GetComponent <PlayerAnimator>();
        playerSkills     = player.GetComponent <PlayerSkills>();
        playerController = player.GetComponent <PlayerController>();

        enemy           = EnemyManager.instance.enemy;
        enemyController = enemy.GetComponent <EnemyController>();
        enemyAnimator   = enemy.GetComponent <EnemyAnimator>();
        enemySkills     = enemy.GetComponent <EnemySkills>();

        uiManager = UIManager.instance;
    }
Пример #8
0
    public EnemySkills decideSkill()
    {
        EnemySkills chosenSkill = null;

        if (!enemyScript.getIsBerserk())
        {
            chosenSkill = generateSkillNormal();
        }
        else
        {
            chosenSkill = generateSkillBerserk();
        }

        return(chosenSkill);
    }
Пример #9
0
 protected override void SetupTableData()
 {
     EnemyData = new ComboBoxInputData("Enemy_ID", "Name", "BaseObject JOIN Enemy", "BaseObjectID = BaseObject_ID", "Name");
     EnemyInput.SelectionChanged   += new SelectionChangedEventHandler(CBChangedEnemy);
     EnemyInput.ItemsSource         = EnemyData.OptionsListNames;
     GridPositionZInput.ItemsSource = GridPositionZOptions;
     GridPositionXInput.ItemsSource = GridPositionXOptions;
     EnemySkills.Setup(ClassTemplateId, "Skill", "Skills", new List <string> {
         "Name", ""
     });
     EnemyWeapons.Setup(ClassTemplateId, "Weapon", "Weapons", new List <string> {
         "Name", ""
     });
     EnemyItems.Setup(ClassTemplateId, "Item", "Items", new List <string> {
         "Name", ""
     });
     PassiveSkillData = new ComboBoxInputData("PassiveSkill_ID", "Name", "BaseObject JOIN PassiveSkill", "BaseObjectID = BaseObject_ID", "Name", ComboBoxInputData.ADD_NULL_INPUT);
     PassiveSkill1Input.ItemsSource = PassiveSkillData.OptionsListNames;
     PassiveSkill2Input.ItemsSource = PassiveSkillData.OptionsListNames;
 }
Пример #10
0
        public override string ValidateInputs()
        {
            string err = "";

            if (!Utils.PosInt(LevelInput.Text, 100) || int.Parse(LevelInput.Text) == 0)
            {
                err += "Level must be an integer between 1 and 100\n";
            }
            if (!Utils.NumberBetween(HPMultiplierInput.Text, 0.1, 100))
            {
                err += "HP x must be a number between 0.1 and 100\n";
            }
            err += EnemySkills.ValidateInputs();
            err += EnemyWeapons.ValidateInputs();
            err += EnemyItems.ValidateInputs();
            if (PassiveSkill1Input.SelectedIndex == PassiveSkill2Input.SelectedIndex && PassiveSkill1Input.SelectedIndex > 0)
            {
                err += "Passive Skills must be unique\n";
            }
            return(err);
        }
Пример #11
0
    // Use this for initialization
    void Start()
    {
        battleManager = BattleManager.instance;
        battleManager.onTurnChange += onTurnChange;
        enemyAnimator = GetComponent <EnemyAnimator>();
        enemySkills   = GetComponent <EnemySkills>();
        enemyStats    = GetComponent <UnitStats>();

        blockIconLeft = GameObject.FindGameObjectsWithTag("BlockIconLeft")[0];
        blockIconLeft.GetComponent <Image>().enabled = true;
        blockIconLeft.SetActive(false);
        blockIconRight = GameObject.FindGameObjectsWithTag("BlockIconRight")[0];
        blockIconRight.GetComponent <Image>().enabled = true;
        blockIconRight.SetActive(false);

        comboIconLeft = GameObject.FindGameObjectsWithTag("ComboIconLeft")[0];
        comboIconLeft.GetComponent <Image>().enabled = true;
        comboIconLeft.SetActive(false);
        comboIconRight = GameObject.FindGameObjectsWithTag("ComboIconRight")[0];
        comboIconRight.GetComponent <Image>().enabled = true;
        comboIconRight.SetActive(false);
    }
 protected override void InitComponents()
 {
     base.InitComponents();
     skills      = GetComponent <EnemySkills>();
     allTargetTF = new Dictionary <int, Transform>();
 }
Пример #13
0
 public void resetSkill()
 {
     currentSkill = null;
 }
Пример #14
0
 public void decideSkill()
 {
     anim.SetBool("B_Atk", true);
     currentSkill = skillDecider.decideSkill();
 }
Пример #15
0
 protected override void OnDelete(SQLiteConnection conn)
 {
     EnemySkills.Delete(conn);
     EnemyWeapons.Delete(conn);
     EnemyItems.Delete(conn);
 }
Пример #16
0
 public IEnumerable <Spell> GetEnemySkills()
 {
     return(EnemySkills.Select(x => x.Value).OrderBy(x => x.Order));
 }
Пример #17
0
 protected override void OnClone(SQLiteConnection conn)
 {
     EnemySkills.Clone(conn, ClassTemplateId);
     EnemyWeapons.Clone(conn, ClassTemplateId);
     EnemyItems.Clone(conn, ClassTemplateId);
 }
 protected override void OnStart()
 {
     skills = GetComponent <EnemySkills>();
     entity.CalculateAllStats();
     entity.FullHeal();
 }