Esempio n. 1
0
 public Assassin()
 {
     SkillBook.Add(new Skill("Coin Flip", $"Flip a coin and decide if you want to actually attack. +{10 + Stats.Damage} damage, or -{10 + Stats.Damage} damage.", 15f, 0f, true, DateTime.Now));
     SkillBook.Add(new Skill("Cut Throat", "Slice someones ankles, cause why would you name the body part your about to attack?", 5f, 3f, true, DateTime.Now));
     SkillBook.Add(new Skill("Kyūketsuki", $"Take on your shadow form and steal +{3 + Stats.Damage} health from the enemy, healing yourself", 10f, 3f, true, DateTime.Now));
     SpellBook.Add(new Spell("Limit Break", $"Remove your earthly form and increase your speed by {2 + Stats.Damage}, can only be used once, and at great cost", "buff", 50f, 0f, false, DateTime.Now));
 }
Esempio n. 2
0
    private void InitHuman()
    {
        InitBaseUnit();

        Class = UnitClassLoader.GetUnitClassById(Template.TypeID);
        if (Class == null)
        {
            Debug.LogFormat("Invalid unit created (class not found, serverId={0}, typeId={1})", Template.ServerID, Template.TypeID);
            Template = null;
            return;
        }

        Width  = Math.Max(1, Template.TokenSize);
        Height = Width;

        CoreStats.Health = CoreStats.HealthMax = Math.Max(Template.HealthMax, 0);
        CoreStats.Mana   = CoreStats.ManaMax = Math.Max(Template.ManaMax, 0); // they sometimes put -1 as mana counter for fighters

        // BRMS
        CoreStats.Body     = (short)Template.Body;
        CoreStats.Reaction = (short)Template.Reaction;
        CoreStats.Mind     = (short)Template.Mind;
        CoreStats.Spirit   = (short)Template.Spirit;

        // speed and scanrange
        CoreStats.RotationSpeed = (byte)Template.RotationSpeed;
        if (CoreStats.RotationSpeed < 1)
        {
            CoreStats.RotationSpeed = 1;
        }
        CoreStats.Speed = (byte)Template.Speed;
        if (CoreStats.Speed < 1)
        {
            CoreStats.Speed = 1;
        }
        CoreStats.ScanRange = Template.ScanRange;

        // human specific
        if (Template.Gender == 1)
        {
            Gender = GenderFlags.Female;
        }
        else
        {
            Gender = GenderFlags.Male;
        }
        // guess class (mage/fighter) from type
        if (Class.ID == 24 || Class.ID == 23) // unarmed mage, mage with staff
        {
            Gender |= GenderFlags.Mage;
        }
        else
        {
            Gender |= GenderFlags.Fighter;  // otherwise its a fighter.
        }
        //
        CoreStats.HealthRegeneration = 100;
        CoreStats.ManaRegeneration   = 100;

        // initial items
        for (int i = 0; i < Template.EquipItems.Length; i++)
        {
            if (Template.EquipItems[i].Length <= 0)
            {
                continue;
            }

            Item item = new Item(Template.EquipItems[i]);
            if (!item.IsValid || item.Class.IsSpecial)
            {
                continue;
            }

            PutItemToBody((BodySlot)item.Class.Option.Slot, item);
        }

        // spellbook
        for (int i = 0; i < 32; i++)
        {
            uint sp = 1u << i;
            if (Template.ManaMax > 0 /* && (Template.KnownSpells & sp) != 0*/)  // [ZZ] uncomment for production!!! currently enables all spells on unit
            {
                Spell cspell = new Spell(i, this);
                SpellBook.Add(cspell);
            }
        }

        // set skills by experience
        // [ZZ] I know that magic and fighting skills are exactly same in the array.
        //      this is written this way in case it changes. will be optimized later
        if ((Gender & GenderFlags.Fighter) != 0)
        {
            SetSkill(ExperienceSkill.Blade, Template.SkillBladeFire);
            SetSkill(ExperienceSkill.Axe, Template.SkillAxeWater);
            SetSkill(ExperienceSkill.Bludgeon, Template.SkillBludgeonAir);
            SetSkill(ExperienceSkill.Pike, Template.SkillPikeEarth);
            SetSkill(ExperienceSkill.Shooting, Template.SkillShootingAstral);
        }
        else if ((Gender & GenderFlags.Mage) != 0)
        {
            SetSkill(ExperienceSkill.Fire, Template.SkillBladeFire);
            SetSkill(ExperienceSkill.Water, Template.SkillAxeWater);
            SetSkill(ExperienceSkill.Air, Template.SkillBludgeonAir);
            SetSkill(ExperienceSkill.Earth, Template.SkillPikeEarth);
            SetSkill(ExperienceSkill.Astral, Template.SkillShootingAstral);
        }

        CoreStats.HealthMax = -1;
        OnUpdateItems();

        // fix health and mana
        Stats.TrySetHealth(Stats.HealthMax);
        Stats.TrySetMana(Stats.ManaMax);
    }
Esempio n. 3
0
    private void InitHuman()
    {
        InitBaseUnit();

        Class = UnitClassLoader.GetUnitClassById(Template.TypeID);
        if (Class == null)
        {
            Debug.LogFormat("Invalid unit created (class not found, serverId={0}, typeId={1})", Template.ServerID, Template.TypeID);
            Template = null;
            return;
        }

        Width  = Math.Max(1, Template.TokenSize);
        Height = Width;

        CoreStats.Health = CoreStats.HealthMax = Math.Max(Template.HealthMax, 0);
        CoreStats.Mana   = CoreStats.ManaMax = Math.Max(Template.ManaMax, 0); // they sometimes put -1 as mana counter for fighters

        // BRMS
        CoreStats.Body     = (short)Template.Body;
        CoreStats.Reaction = (short)Template.Reaction;
        CoreStats.Mind     = (short)Template.Mind;
        CoreStats.Spirit   = (short)Template.Spirit;

        // speed and scanrange
        CoreStats.RotationSpeed = (byte)Template.RotationSpeed;
        if (CoreStats.RotationSpeed < 1)
        {
            CoreStats.RotationSpeed = 1;
        }
        CoreStats.Speed = (byte)Template.Speed;
        if (CoreStats.Speed < 1)
        {
            CoreStats.Speed = 1;
        }
        CoreStats.ScanRange = Template.ScanRange;

        // human specific
        if (Template.Gender == 1)
        {
            Gender = GenderFlags.Female;
        }
        else
        {
            Gender = GenderFlags.Male;
        }
        // guess class (mage/fighter) from type
        if (Class.ID == 24 || Class.ID == 23) // unarmed mage, mage with staff
        {
            Gender |= GenderFlags.Mage;
        }
        else
        {
            Gender |= GenderFlags.Fighter;  // otherwise its a fighter.
        }
        // initial items
        for (int i = 0; i < Template.EquipItems.Length; i++)
        {
            if (Template.EquipItems[i].Length <= 0)
            {
                continue;
            }

            Item item = new Item(Template.EquipItems[i]);
            if (!item.IsValid || item.Class.IsSpecial)
            {
                continue;
            }

            PutItemToBody((BodySlot)item.Class.Option.Slot, item);
        }

        // spellbook
        for (int i = 0; i < 32; i++)
        {
            uint sp = 1u << i;
            if (Template.ManaMax > 0 && (Template.KnownSpells & sp) != 0)
            {
                Spell cspell = new Spell(i, this);
                SpellBook.Add(cspell);
            }
        }

        CalculateVision();
        UpdateItems();

        // add item for testing
        if (!NetworkManager.IsClient)
        {
            ItemsPack.PutItem(ItemsPack.Count, new Item("Very Rare Crystal Ring {body=4}"));
            ItemsPack.PutItem(ItemsPack.Count, new Item("Very Rare Crystal Amulet {body=4}"));
            ItemsPack.PutItem(ItemsPack.Count, new Item("Potion Body"));
            ItemsPack.PutItem(ItemsPack.Count, new Item("Very Rare Meteoric Plate Cuirass {body=4}"));
            ItemsPack.PutItem(ItemsPack.Count, new Item("Very Rare Meteoric Plate Cuirass {body=4}"));
            ItemsPack.PutItem(ItemsPack.Count, new Item("Wood Shaman Staff {castSpell=Fire_Ball:100}"));

            /*                    MapProjectile proj = new MapProjectile(15);
             *      proj.SetPosition(16, 16, 0);
             *      proj.Target = ConsolePlayer.Avatar;
             *      Objects.Add(proj);
             */ItemsPack.PutItem(ItemsPack.Count, new Item("Very Rare Meteoric Crossbow"));
        }
    }
 public void AddSpell(ISpell spell)
 {
     SpellBook.Add(spell);
 }
Esempio n. 5
0
 public void AddToSpellBook(Spell spell)
 {
     SpellBook.Add(spell);
 }