Esempio n. 1
0
 public void SetSecondMagicSkill(MagicSkill skill)
 {
     if (skills.Contains(skill))
     {
         SecondActiveMagicSkill = skill;
         UIEventHandler.PlayerSkillsChanged(this);
     }
 }
Esempio n. 2
0
        public void SetUp()
        {
            GameTime.Reset();

            herb             = new UsableItem();
            herb.Id          = 0;
            herb.Name        = "Herb";
            herb.Description = "A common herb";
            coin             = new UsableItem();
            coin.Id          = 1;
            coin.Name        = "Coin";
            coin.Description = "A gold coin";

            passiveMagicSkill = new PassiveMagicSkill(id: 0,
                                                      name: "ShadowStrength",
                                                      description: "A +10 Buff to the user's strength.",
                                                      cooldownTime: 5,
                                                      itemSequence: new int[] { herb.Id },
                                                      cost: 10,
                                                      duration: 10,
                                                      modifierValue: 10,
                                                      modifiedAttributeName: "Body");
            offensiveMagicSkill = new OffensiveMagicSkill(id: 1,
                                                          name: "Fireball",
                                                          description: "A ball of fire.",
                                                          cooldownTime: 5,
                                                          itemSequence: new int[] { coin.Id, herb.Id },
                                                          damage: 1,
                                                          maximumTargets: 2,
                                                          range: 2,
                                                          cost: 1);
            meleeSkill = new GenericCombatSkill(id: 1,
                                                name: "SwordFighting",
                                                description: "Wield a sword effectively.",
                                                cooldownTime: 1,
                                                damage: 1,
                                                maximumTargets: 1,
                                                range: 1,
                                                itemSequence: new int[] { });
            meleeMultiTargetsSkill = new GenericCombatSkill(id: 2,
                                                            name: "MultiHit",
                                                            description: "Wield a sword against multiple opponents.",
                                                            cooldownTime: 1,
                                                            damage: 1,
                                                            maximumTargets: 2,
                                                            range: 1,
                                                            itemSequence: new int[] { });
            rangedSkill = new GenericCombatSkill(id: 3,
                                                 name: "Longbow",
                                                 description: "Notch! Aim! Loose!",
                                                 cooldownTime: 1,
                                                 damage: 1,
                                                 maximumTargets: 1,
                                                 range: 10,
                                                 itemSequence: new int[] { });
        }
Esempio n. 3
0
    void Start()
    {
        player   = FindObjectOfType <PlayerEngine>().gameObject;
        strSkill = player.GetComponent <StrengthSkill>();
        defSkill = player.GetComponent <DefenseSkill>();
        magSkill = player.GetComponent <MagicSkill>();
        theQM    = FindObjectOfType <QuestManager>();
        theDM    = FindObjectOfType <DialogManager>();
        pDef     = DefenseSkill.defLvl;
        bossAnim = transform.GetChild(0).GetComponent <Animator>();

        nameO = "Ezekiel";
    }
Esempio n. 4
0
        public void SetUp()
        {
            Controller.Enemies = new List <Enemy>();
            player             = new Player("Player");
            enemy      = new Enemy("Enemy");
            meleeSkill = new GenericCombatSkill(id: 0,
                                                name: "SwordFighting",
                                                description: "Wield a sword effectively.",
                                                cooldownTime: 1,
                                                damage: 1,
                                                maximumTargets: 1,
                                                range: 1,
                                                itemSequence: new int[] { });
            passiveMagicSkill = new PassiveMagicSkill(id: 0,
                                                      name: "ShadowStrength",
                                                      description: "A +10 Buff to the user's strength.",
                                                      cooldownTime: 5,
                                                      itemSequence: new int[] { },
                                                      cost: 10,
                                                      duration: 10,
                                                      modifierValue: 10,
                                                      modifiedAttributeName: "Body");
            SkillDatabase.MagicSkills  = new MagicSkill[] { passiveMagicSkill };
            SkillDatabase.CombatSkills = new CombatSkill[] { meleeSkill };

            sword        = new WeaponItem();
            sword.Id     = 0;
            sword.Name   = "Sword";
            sword.Range  = 1;
            sword.Damage = 1;
            sword.Speed  = 0.5f;

            beretta        = new WeaponItem();
            sword.Id       = 1;
            beretta.Name   = "Beretta";
            beretta.Range  = 10;
            beretta.Damage = 10;
            beretta.Speed  = 2;

            ItemDatabase.Items = new BaseItem[] { sword, beretta };

            player.LearnCombatSkill(meleeSkill.Id);
            player.LearnMagicSkill(passiveMagicSkill.Id);
            enemy.Stats.Life.Value       = 10;
            enemy.Stats.Experience.Value = 66;
            GameTime.Reset();
            player.OnCombatSkillTriggered += CombatSkillTriggered;
            enemy.OnCombatSkillTriggered  += CombatSkillTriggered;
        }
Esempio n. 5
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("CreatureType", true, out subEle);
            subEle.Value = CreatureType.ToString();

            ele.TryPathTo("Skill/Combat", true, out subEle);
            subEle.Value = CombatSkill.ToString();

            ele.TryPathTo("Skill/Magic", true, out subEle);
            subEle.Value = MagicSkill.ToString();

            ele.TryPathTo("Skill/Stealth", true, out subEle);
            subEle.Value = StealthSkill.ToString();

            ele.TryPathTo("Health", true, out subEle);
            subEle.Value = Health.ToString();

            WriteUnusedXML(ele, master);

            ele.TryPathTo("Damage", true, out subEle);
            subEle.Value = Damage.ToString();

            ele.TryPathTo("Strength", true, out subEle);
            subEle.Value = Strength.ToString();

            ele.TryPathTo("Perception", true, out subEle);
            subEle.Value = Perception.ToString();

            ele.TryPathTo("Endurance", true, out subEle);
            subEle.Value = Endurance.ToString();

            ele.TryPathTo("Charisma", true, out subEle);
            subEle.Value = Charisma.ToString();

            ele.TryPathTo("Intelligence", true, out subEle);
            subEle.Value = Intelligence.ToString();

            ele.TryPathTo("Agility", true, out subEle);
            subEle.Value = Agility.ToString();

            ele.TryPathTo("Luck", true, out subEle);
            subEle.Value = Luck.ToString();
        }
        public void SetUp()
        {
            herb             = new UsableItem();
            herb.Id          = 0;
            herb.Name        = "Herb";
            herb.Description = "A common herb";
            coin             = new UsableItem();
            coin.Id          = 1;
            coin.Name        = "Coin";
            coin.Description = "A gold coin";

            GameTime.Reset();
            player = new Player("John");
            enemy  = new Enemy("Zombie");
            enemy.Stats.Magic.Value = 30;
            passiveMagicSkill       = new PassiveMagicSkill(id: 0,
                                                            name: "ShadowStrength",
                                                            description: "A +10 Buff to the user's strength.",
                                                            cost: 10,
                                                            duration: 10,
                                                            cooldownTime: 5,
                                                            modifierValue: 10,
                                                            modifiedAttributeName: "Body",
                                                            itemSequence: new int[] { herb.Id });

            offensiveMagicSkill = new OffensiveMagicSkill(id: 1,
                                                          name: "Fireball",
                                                          description: "A ball of fire.",
                                                          cooldownTime: 5,
                                                          itemSequence: new int[] { herb.Id },
                                                          damage: 1,
                                                          maximumTargets: 2,
                                                          range: 2,
                                                          cost: 1);

            SkillDatabase.MagicSkills = new MagicSkill[] { passiveMagicSkill, offensiveMagicSkill };

            player.OnMagicSkillTriggered += MagicSkillTriggered;
        }
Esempio n. 7
0
 public string updateMagic(MagicSkill ms)
 {
     return(this.magicE.updateMagic(ms));
     //throw new NotImplementedException();
 }
Esempio n. 8
0
    public static void Setup()
    {
        if (Skills.Count != 0)
            return; // been here, done this

        // stats
        Might = new Attribute();
        Might.Name = "Might";
        Might.SkillType = Skill.SkillTypes.Attribute;
        Might.IconImage = "GUI/SkillIcons/Might";
        Might.AttributeType = Attribute.AttributeTypes.Might;
        Might.Description = "Physical Ability. Affects hit points and melee attacks.";

        Smarts = new Attribute();
        Smarts.Name = "Smarts";
        Smarts.SkillType = Skill.SkillTypes.Attribute;
        Smarts.AttributeType = Attribute.AttributeTypes.Smarts;
        Smarts.IconImage = "GUI/SkillIcons/Smarts";
        Smarts.Description = "Mental Ability. Affects magic points and magical attacks.";

        Agility = new Attribute();
        Agility.Name = "Agility";
        Agility.SkillType = Skill.SkillTypes.Attribute;
        Agility.AttributeType = Attribute.AttributeTypes.Agility;
        Agility.IconImage = "GUI/SkillIcons/Speed";
        Agility.Description = "Dexterity Ability. Affects defense and ranged attacks.";

        // weapon skills
        AddWeaponSkill("Swords", "GUI/SkillIcons/Sword", Weapon.WeaponTypes.Sword).Requirements.Add("Might 1");
        AddWeaponSkill("Bows", "GUI/SkillIcons/Bows", Weapon.WeaponTypes.Bow).Requirements.Add("Agility 1");
        AddWeaponSkill("Staves", "GUI/SkillIcons/Staves", Weapon.WeaponTypes.Staff).Requirements.Add("Smarts 1");
        AddSkill("Fist", "GUI/SkillIcons/Fist", new FistWeapon());

        // magics
        MagicSkill arcane = new MagicSkill(true);
        arcane.SkillType = Skill.SkillTypes.MagicArcane;
        arcane.Requirements.Add("Smarts 2");
        arcane.AdditionalSkillsGranted.Add("Magic Missile");
        arcane.Purchase = 100;
        arcane.Upgrade = 500;
        arcane.MaxLevel = 10;
        arcane.Description = "Enables the casting of Arcane Magics";
        AddSkill("Arcane", "GUI/SkillIcons/Arcane", arcane);

        MagicSkill divine = new MagicSkill(false);
        divine.SkillType = Skill.SkillTypes.MagicDivine;
        divine.Requirements.Add("Smarts 2");
        divine.AdditionalSkillsGranted.Add("Bless");
        divine.Purchase = 100;
        divine.Upgrade = 500;
        divine.MaxLevel = 10;
        divine.Description = "Enables the casting of Divine Magics";
        AddSkill("Divine", "GUI/SkillIcons/Divine", divine);

        // bonuses
        AddSkill("Dodge", "GUI/SkillIcons/Dodge", new Dodge());
        AddSkill("Tough", "GUI/SkillIcons/Tough", new ToughAsNails());
        AddSkill("Deadeye", "GUI/SkillIcons/Deadeye", new ToughAsNails());

        // attacks
        AddSkill("Cleave", "GUI/SkillIcons/Cleave", new Cleave()).Cooldown = 10;
        AddSkill("Headshot", "GUI/SkillIcons/Headshot", new Headshot());
        AddSkill("Claw", "GUI/SkillIcons/Beast", new Claw());

        // base attacks
        BasicAttacks.Add(Weapon.WeaponTypes.Hand, new BasicWeaponAttack("Punch", "GUI/SkillIcons/Fist", Weapon.WeaponTypes.Hand));
        BasicAttacks.Add(Weapon.WeaponTypes.Sword, new BasicWeaponAttack("Slash", "GUI/SkillIcons/Sword", Weapon.WeaponTypes.Sword));
        BasicAttacks.Add(Weapon.WeaponTypes.Staff, new BasicWeaponAttack("Whack", "GUI/SkillIcons/Staves", Weapon.WeaponTypes.Staff));
        BasicAttacks.Add(Weapon.WeaponTypes.Bow, new BasicWeaponAttack("Shoot", "GUI/SkillIcons/Bows", Weapon.WeaponTypes.Bow));
    }
Esempio n. 9
0
            /// <summary>
            /// Will get magic skill details about the passed magic skill
            /// </summary>
            /// <param name="skill">Magic skill to get details about</param>
            /// <returns></returns>
            public SkillDetails GetMagicSkillDetails(MagicSkill skill)
            {
                // Get magic skill information from fface
                PlayerMagicSkills magicSkills = GetPlayerInformation().MagicSkills;

                // value of specific magic skill
                int value = 0;

                // see which skill is selected
                switch (skill)
                {
                    case MagicSkill.BlueMagic:
                        value = magicSkills.BlueMagic;
                        break;
                    case MagicSkill.Dark:
                        value = magicSkills.Dark;
                        break;
                    case MagicSkill.Divine:
                        value = magicSkills.Divine;
                        break;
                    case MagicSkill.Elemental:
                        value = magicSkills.Elemental;
                        break;
                    case MagicSkill.Enfeebling:
                        value = magicSkills.Enfeebling;
                        break;
                    case MagicSkill.Enhancing:
                        value = magicSkills.Enhancing;
                        break;
                    case MagicSkill.Healing:
                        value = magicSkills.Healing;
                        break;
                    case MagicSkill.Ninjitsu:
                        value = magicSkills.Ninjitsu;
                        break;
                    case MagicSkill.Singing:
                        value = magicSkills.Singing;
                        break;
                    case MagicSkill.String:
                        value = magicSkills.String;
                        break;
                    case MagicSkill.Summoning:
                        value = magicSkills.Summon;
                        break;
                    case MagicSkill.Wind:
                        value = magicSkills.Wind;
                        break;
                    default:
                        throw new ArgumentException("Unknown magic skill passed to GetMagicSkillDetails()");

                } // @ switch (skill)

                SkillDetails details = new SkillDetails();
                details.Level = (value & 0xFFF);
                details.Capped = Convert.ToBoolean(((value & 0x8000) >> 15));
                details.SkillType = MagicOrCombat.Magic;
                details.Skill = (int)skill;
                return details;
            }
Esempio n. 10
0
    void Start()
    {
        anim = gameObject.transform.GetChild(0).GetComponent <Animator>();

        foreach (Transform child in transform)
        {
            if (child.CompareTag("Enemy"))
            {
                eHealth     = 10f;
                eSpeed      = 0.5f;
                eCoinReward = 5;
                eDefense    = 3f;
                eStrength   = 1f;
                eRange      = 5.75f;
                roamRange   = 1.5f;
                coolDown    = 3f;
                eWeak       = 2;
                ePower      = 0;
                questName   = "Enemy";
                Aggro       = false;
            }
            else if (child.CompareTag("Chicken"))
            {
                eHealth     = 3f;
                eSpeed      = 0.75f;
                eCoinReward = 2;
                eDefense    = 1f;
                eStrength   = 1f;
                eRange      = 3f;
                roamRange   = 4f;
                coolDown    = 2f;
                questName   = "Chicken";
                Aggro       = false;
            }
            else if (child.CompareTag("Zombie"))
            {
                eHealth     = 10f;
                eSpeed      = 0.3f;
                eCoinReward = 15;
                eDefense    = 5f;
                eStrength   = 5f;
                eRange      = 5.75f;
                roamRange   = 4f;
                coolDown    = 3f;
                eWeak       = 2;
                ePower      = 0;
                questName   = "Zombie";
                Aggro       = true;
            }
            else if (child.CompareTag("Skeleton"))
            {
                eHealth     = 15f;
                eSpeed      = 0.75f;
                eCoinReward = 20;
                eDefense    = 7f;
                eStrength   = 7f;
                eRange      = 5.75f;
                roamRange   = 8f;
                coolDown    = 1f;
                eWeak       = 0;
                ePower      = 2;
                questName   = "Skeleton";
                Aggro       = true;
            }
            else if (child.CompareTag("Goblin"))
            {
                eHealth     = 20f;
                eSpeed      = 0.6f;
                eCoinReward = 50;
                eDefense    = 15f;
                eStrength   = 15f;
                eRange      = 3.75f;
                roamRange   = 5f;
                coolDown    = 2f;
                eWeak       = 1;
                ePower      = 0;
                questName   = "Goblin";
                Aggro       = false;
            }
        }

        player = GameObject.FindGameObjectWithTag("Player");

        eTar         = Instantiate(eTarget, transform.position, Quaternion.identity).GetComponent <RoamTarget>();
        eTar.spawner = spawner;
        eTar.enemy   = gameObject;

        aiPath      = GetComponent <AIPath>();
        theQM       = FindObjectOfType <QuestManager>();
        theDM       = FindObjectOfType <DialogManager>();
        spawnScript = spawner.GetComponent <SpawnEnemy>();
        strSkill    = player.GetComponent <StrengthSkill>();
        defSkill    = player.GetComponent <DefenseSkill>();
        magSkill    = player.GetComponent <MagicSkill>();

        nAggro       = Aggro;
        countDown    = coolDown;
        startPos     = transform.position;
        aiPath.speed = eSpeed;
        roaming      = true;
        pDef         = DefenseSkill.defLvl;
    }
Esempio n. 11
0
            } // @ public CraftDetails GetCraftDetails(Craft craft)

            /// <summary>
            /// Will get magic skill details about the passed magic skill
            /// </summary>
            /// <param name="skill">Magic skill to get details about</param>
            /// <returns></returns>
            public SkillDetails GetMagicSkillDetails(MagicSkill skill)
            {
                // Get magic skill information from fface
                PlayerMagicSkills magicSkills = GetPlayerInformation().MagicSkills;

                // value of specific magic skill
                int value = 0;

                // see which skill is selected
                switch (skill)
                {
                case MagicSkill.BlueMagic:
                    value = magicSkills.BlueMagic;
                    break;

                case MagicSkill.Dark:
                    value = magicSkills.Dark;
                    break;

                case MagicSkill.Divine:
                    value = magicSkills.Divine;
                    break;

                case MagicSkill.Elemental:
                    value = magicSkills.Elemental;
                    break;

                case MagicSkill.Enfeebling:
                    value = magicSkills.Enfeebling;
                    break;

                case MagicSkill.Enhancing:
                    value = magicSkills.Enhancing;
                    break;

                case MagicSkill.Healing:
                    value = magicSkills.Healing;
                    break;

                case MagicSkill.Ninjitsu:
                    value = magicSkills.Ninjitsu;
                    break;

                case MagicSkill.Singing:
                    value = magicSkills.Singing;
                    break;

                case MagicSkill.String:
                    value = magicSkills.String;
                    break;

                case MagicSkill.Summoning:
                    value = magicSkills.Summon;
                    break;

                case MagicSkill.Wind:
                    value = magicSkills.Wind;
                    break;

                default:
                    throw new ArgumentException("Unknown magic skill passed to GetMagicSkillDetails()");
                } // @ switch (skill)

                SkillDetails details = new SkillDetails();

                details.Level     = (value & 0xFFF);
                details.Capped    = Convert.ToBoolean(((value & 0x8000) >> 15));
                details.SkillType = MagicOrCombat.Magic;
                details.Skill     = (int)skill;
                return(details);
            } // @ public SkillDetails GetMagicSkillDetail(MagicSkill skill)
Esempio n. 12
0
    public static void Setup()
    {
        if (Skills.Count != 0)
        {
            return; // been here, done this
        }
        // stats
        Might               = new Attribute();
        Might.Name          = "Might";
        Might.SkillType     = Skill.SkillTypes.Attribute;
        Might.IconImage     = "GUI/SkillIcons/Might";
        Might.AttributeType = Attribute.AttributeTypes.Might;
        Might.Description   = "Physical Ability. Affects hit points and melee attacks.";

        Smarts               = new Attribute();
        Smarts.Name          = "Smarts";
        Smarts.SkillType     = Skill.SkillTypes.Attribute;
        Smarts.AttributeType = Attribute.AttributeTypes.Smarts;
        Smarts.IconImage     = "GUI/SkillIcons/Smarts";
        Smarts.Description   = "Mental Ability. Affects magic points and magical attacks.";

        Agility               = new Attribute();
        Agility.Name          = "Agility";
        Agility.SkillType     = Skill.SkillTypes.Attribute;
        Agility.AttributeType = Attribute.AttributeTypes.Agility;
        Agility.IconImage     = "GUI/SkillIcons/Speed";
        Agility.Description   = "Dexterity Ability. Affects defense and ranged attacks.";

        // weapon skills
        AddWeaponSkill("Swords", "GUI/SkillIcons/Sword", Weapon.WeaponTypes.Sword).Requirements.Add("Might 1");
        AddWeaponSkill("Bows", "GUI/SkillIcons/Bows", Weapon.WeaponTypes.Bow).Requirements.Add("Agility 1");
        AddWeaponSkill("Staves", "GUI/SkillIcons/Staves", Weapon.WeaponTypes.Staff).Requirements.Add("Smarts 1");
        AddSkill("Fist", "GUI/SkillIcons/Fist", new FistWeapon());

        // magics
        MagicSkill arcane = new MagicSkill(true);

        arcane.SkillType = Skill.SkillTypes.MagicArcane;
        arcane.Requirements.Add("Smarts 2");
        arcane.AdditionalSkillsGranted.Add("Magic Missile");
        arcane.Purchase    = 100;
        arcane.Upgrade     = 500;
        arcane.MaxLevel    = 10;
        arcane.Description = "Enables the casting of Arcane Magics";
        AddSkill("Arcane", "GUI/SkillIcons/Arcane", arcane);

        MagicSkill divine = new MagicSkill(false);

        divine.SkillType = Skill.SkillTypes.MagicDivine;
        divine.Requirements.Add("Smarts 2");
        divine.AdditionalSkillsGranted.Add("Bless");
        divine.Purchase    = 100;
        divine.Upgrade     = 500;
        divine.MaxLevel    = 10;
        divine.Description = "Enables the casting of Divine Magics";
        AddSkill("Divine", "GUI/SkillIcons/Divine", divine);

        // bonuses
        AddSkill("Dodge", "GUI/SkillIcons/Dodge", new Dodge());
        AddSkill("Tough", "GUI/SkillIcons/Tough", new ToughAsNails());
        AddSkill("Deadeye", "GUI/SkillIcons/Deadeye", new ToughAsNails());

        // attacks
        AddSkill("Cleave", "GUI/SkillIcons/Cleave", new Cleave()).Cooldown = 10;
        AddSkill("Headshot", "GUI/SkillIcons/Headshot", new Headshot());
        AddSkill("Claw", "GUI/SkillIcons/Beast", new Claw());

        // base attacks
        BasicAttacks.Add(Weapon.WeaponTypes.Hand, new BasicWeaponAttack("Punch", "GUI/SkillIcons/Fist", Weapon.WeaponTypes.Hand));
        BasicAttacks.Add(Weapon.WeaponTypes.Sword, new BasicWeaponAttack("Slash", "GUI/SkillIcons/Sword", Weapon.WeaponTypes.Sword));
        BasicAttacks.Add(Weapon.WeaponTypes.Staff, new BasicWeaponAttack("Whack", "GUI/SkillIcons/Staves", Weapon.WeaponTypes.Staff));
        BasicAttacks.Add(Weapon.WeaponTypes.Bow, new BasicWeaponAttack("Shoot", "GUI/SkillIcons/Bows", Weapon.WeaponTypes.Bow));
    }