Ejemplo n.º 1
0
    public game_item(item_type _type, int _id_sprite, SpriteGender _gender,
                     int _Order_ID, string _name, Basic_Stats stats, UseBoost pstats, item_rarity.rarity _rarity, bool Is_armor, int item_level = 0)
    {
        ID = ITEM_COUNTER;
        ITEM_COUNTER++;

        bstats      = stats;
        this.pstats = pstats;
        IsArmor     = Is_armor;

        NAME         = _name;
        type         = _type;
        id_sprite    = _id_sprite;
        gender       = _gender;
        ORD          = _Order_ID;
        slot_pointer = null;
        count        = 1;

        if (_id_sprite == -1)
        {
            id_sprite = CONSUMABLE_SP_ID;
            CONSUMABLE_SP_ID--;
        }
        if (ORD == -1)
        {
            ORD = CONSUMABLE_SP_ID;
        }

        rarity = new item_rarity(bstats, _rarity, item_level);
    }
Ejemplo n.º 2
0
    public void CreateStatEnchanter(Basic_Stats stats, UseBoost pstats, string name, Sprite sprite)
    {
        game_item NEW_item = new game_item(item_type.consumable, -1, SpriteGender.none,
                                           -1, name, stats, pstats, item_rarity.rarity.simple, false);

        Game_Items[SpriteGender.none][item_type.consumable].Add(NEW_item.Order_ID, NEW_item);
        item_icons.Add(NEW_item.id_sprite, sprite);
    }
Ejemplo n.º 3
0
 public void decBoost(UseBoost b)
 {
     armor        -= b.armor;
     healing      -= b.healing;
     health       -= b.health;
     evasion      -= b.evasion;
     physical_dmg -= b.physical_dmg;
     magical_dmg  -= b.magical_dmg;
     range        -= b.range;
 }
Ejemplo n.º 4
0
 public void AddBoost(UseBoost b)
 {
     armor        += b.armor;
     healing      += b.healing;
     health       += b.health;
     evasion      += b.evasion;
     physical_dmg += b.physical_dmg;
     magical_dmg  += b.magical_dmg;
     range        += b.range;
 }
Ejemplo n.º 5
0
 public void AddPStats(UseBoost b)
 {
     pstats.AddBoost(b);
     pstats.healing   = 0;
     walk_speed.sleep = (pstats.walk_speed * 0.01f + (agility * 0.001f)) * ACT;
     if (b.healing > 0)
     {
         hp.GotHeal(pstats.healing);
     }
 }
Ejemplo n.º 6
0
 public void Update()
 {
     if (slot != Inv_slot.item_Poiner)
     {
         slot = Inv_slot.item_Poiner;
         if (slot != null && slot.item != null)
         {
             stats  = slot.item.bstats;
             pstats = slot.item.pstats;
         }
     }
 }
Ejemplo n.º 7
0
    public C_Stats(Health _hp)
    {
        stats  = new Basic_Stats();
        pstats = new UseBoost(0, 0, 4, 102, 0, 0, 0, 0, 0);
        hp     = _hp;

        endurance    = 8f;
        strength     = 8f;
        intelligence = 8f;

        mobility = 130f;

        range   = 12f;
        agility = 8f;
    }
Ejemplo n.º 8
0
    public void CreateStatEnchanter(float agility, float endurance, float strength, float intelligence,
                                    float mobility, float health, float hregen, float healing, float magical_dmg,
                                    float evashion, float armor, float range, float physical_dmg,
                                    string name, Sprite sprite)
    {
        Basic_Stats stats = new Basic_Stats();

        stats.agility   = agility;
        stats.endurance = endurance;
        stats.strength  = strength;

        stats.intelligence = intelligence;

        UseBoost pstats = new UseBoost(armor, healing, health, hregen, evashion, physical_dmg, magical_dmg, range, mobility);

        game_item NEW_item = null;

        try
        {
            NEW_item = new game_item(item_type.consumable, -1, SpriteGender.none,
                                     -1, name, stats, pstats, item_rarity.rarity.simple, false);
        }
        catch
        {
            Debug.Log("(CreateStatEnchanter) : error creating item");
        }
        try
        {
            Game_Items[SpriteGender.none][item_type.consumable].Add(NEW_item.Order_ID, NEW_item);
        }
        catch
        {
            Debug.Log("(CreateStatEnchanter) : Error in storing item");
        }
        if (NEW_item != null)
        {
            item_icons.Add(NEW_item.id_sprite, sprite);
        }
    }
Ejemplo n.º 9
0
 public void DecresePStats(UseBoost b)
 {
     pstats.decBoost(b);
     pstats.healing   = 0;
     walk_speed.sleep = (pstats.walk_speed * 0.01f + (agility * 0.001f)) * ACT;
 }
Ejemplo n.º 10
0
    private void CreateItems(SpriteData sd)
    {
        bool IsArmor  = (sd.path.Contains("armor")) ? true : false;
        bool IsWeapon = (sd.path.Contains("weapons")) ? true : false;
        int  MaxValue = (IsArmor) ? 14 : IsArmor ? 20 : 6;


        if (sd.path.Contains("walk_melee_weapons"))
        {
            walk_anim = new game_item(item_type.none, sd.id, sd.sg,
                                      0, sd.name, Basic_Stats.zero, UseBoost.zero, item_rarity.rarity.normal, false);
            return;
        }
        foreach (item_type type in Enum.GetValues(typeof(item_type)))
        {
            if (sd.key.Contains(type.ToString()))
            {
                foreach (item_rarity.rarity rare in Enum.GetValues(typeof(item_rarity.rarity)))
                {
                    if (!IsWeapon && !IsArmor && rare != item_rarity.rarity.normal)
                    {
                        continue;
                    }

                    Basic_Stats stats  = new Basic_Stats();
                    UseBoost    pstats = UseBoost.zero;
                    stats.agility   = InGameData.rand(0, MaxValue);
                    stats.endurance = InGameData.rand(0, MaxValue);
                    stats.strength  = InGameData.rand(0, MaxValue);


                    if (sd.path.Contains("small_range"))
                    {
                        pstats.range = 2f;
                    }
                    else if (sd.path.Contains("normal_range"))
                    {
                        pstats.range = 10f;
                    }
                    else if (sd.path.Contains("large_range"))
                    {
                        pstats.range = 15f;
                    }
                    else if (type == item_type.wand)
                    {
                        pstats.range = 75.0f;
                    }
                    else if (type == item_type.bow)
                    {
                        pstats.range = 75.0f;
                    }
                    else
                    {
                        pstats.range = 0;
                    }
                    stats.intelligence = InGameData.rand(0, MaxValue);
                    pstats.walk_speed  = InGameData.rand(0, MaxValue);
                    game_item NEW_item = new game_item(type, sd.id, sd.sg,
                                                       Game_Items[sd.sg][type].Count, sd.name, stats, pstats, rare, IsArmor);
                    if (sd.sg == SpriteGender.none)
                    {
                        Game_Items[SpriteGender.male][type].Add(NEW_item.Order_ID, NEW_item);
                        Game_Items[SpriteGender.female][type].Add(NEW_item.Order_ID, NEW_item);
                    }
                    Game_Items[sd.sg][type].Add(NEW_item.Order_ID, NEW_item);
                }
                break;
            }
        }
    }