Ejemplo n.º 1
0
    public void GenerateAttributes(AInventory <TModuleType> aInventory, AttributeInitializer <TModuleType> attributeInitializer)
    {
        foreach (AWeapon <TModuleType> weapon in aInventory.Weapons)
        {
            if (null == weapon.fixedAttributes || null == attributeInitializer)
            {
                Debug.Log("it shouldn't work");
            }
            else
            {
                attributeInitializer.GenerateStuffAttribute(weapon);
            }
        }

        foreach (AClothe <TModuleType> clothe in aInventory.Clothes)
        {
            if (null == clothe.fixedAttributes || null == attributeInitializer)
            {
                Debug.Log("it shouldn't work");
            }
            else
            {
                attributeInitializer.GenerateStuffAttribute(clothe);
            }
        }
    }
Ejemplo n.º 2
0
    public AClothe()
    {
        this.levelRequiered    = 5;
        this.filtre            = ItemExtension.FiltreClothe;
        this.equipmentCategory = e_equipmentCategory.Clothe;
        this.price             = 50 * (((int)this.equipmentQuality) + 1);

        this.clotheCategory = e_clotheCategory.Armor;
        //clotheCategory = (e_clotheCategory)Random.Range(0, (int)(e_clotheCategory.SIZE));
        this.equipmentEmplacement = e_equipmentEmplacement.Armor;
        this.weight = 18f;
        AttributeInitializer <TModuleType> .AddFixedAttribute(e_entityAttribute.Defence, new Vector2(50, 75), this);

        this.AddRandomAttribute(e_entityAttribute.Vitality, 20, new Vector2(2, 4));
        this.AddRandomAttribute(e_entityAttribute.Endurance, 20, new Vector2(2, 4));
        this.AddRandomAttribute(e_entityAttribute.Life, 20, new Vector2(25, 32));
        this.AddRandomAttribute(e_entityAttribute.Life_Percent, 50, new Vector2(3f, 4.5f));
        this.AddRandomAttribute(e_entityAttribute.Mana, 35, new Vector2(13, 16));
        this.AddRandomAttribute(e_entityAttribute.Resistance, 50, new Vector2(2, 4));
        this.AddRandomAttribute(e_entityAttribute.Mana_Percent, 50, new Vector2(3f, 5f));
        this.AddRandomAttribute(e_entityAttribute.Energy, 50, new Vector2(2, 4));

        //EquipmentAtt

        //switch (clotheCategory)
        //{
        //    case e_clotheCategory.Armor :		equipmentEmplacement = e_equipmentEmplacement.Armor;	break;
        //    case e_clotheCategory.Belt :		equipmentEmplacement = e_equipmentEmplacement.Belt;		break;
        //    case e_clotheCategory.Glove :		equipmentEmplacement = e_equipmentEmplacement.Glove;	break;
        //    case e_clotheCategory.Helmet:		equipmentEmplacement = e_equipmentEmplacement.Helmet;	break;
        //    case e_clotheCategory.Shoes :		equipmentEmplacement = e_equipmentEmplacement.Shoes;	break;
        //    case e_clotheCategory.Troussers :	equipmentEmplacement = e_equipmentEmplacement.Trousers;	break;
        //}
    }
Ejemplo n.º 3
0
    public override void Initialize(TModuleType player)
    {
        base.SetModule(player, "Scripts/Behaviour/Items");

        this.inventory            = new Inventory <TModuleType>();
        this.equipment            = new Equipment <TModuleType>();
        this.attribute            = base.ModuleManager.Attributes;
        this.attributeInitializer = new AttributeInitializer <TModuleType>();
        //this.itemManagerGUI = gameObject.GetComponent<ItemManagerGUI>() as ItemManagerGUI;
        this.attributeInitializer.InitializeByPlayerAttribute(this.attribute);
    }
Ejemplo n.º 4
0
    public void GenerateItems(AInventory <TModuleType> itemContainer, AttributeInitializer <TModuleType> attributeInitializer, List <AItem <TModuleType> > fixedStuff = null)//rajouter la position du coffre en parametre
    {
        this.stuffGenerator.AddFixedItems(itemContainer, fixedStuff);
        this.stuffGenerator.GenerateRandomItems(itemContainer);
        if (itemContainer.Items.Count > 0)
        {
            this.stuffGenerator.GenerateAttributes(itemContainer, attributeInitializer);
        }

        //Debug.Log("I generated " + itemContainer.items.Count + " items")
        this.ThrowAndClearItemsListIfOnGround(itemContainer);
    }
Ejemplo n.º 5
0
    //public override void Attack() { }

    public ACast()
    {
        this.equipmentCategory = e_equipmentCategory.Cast;
        this.filtre            = ItemExtension.FiltreWeapon;
        this.price             = 150 * (((int)equipmentQuality) + 1);


        this.AddRandomAttribute(e_entityAttribute.Mana, 20, new Vector2(10, 14));
        this.AddRandomAttribute(e_entityAttribute.Energy, 20, new Vector2(3, 4));
        this.AddRandomAttribute(e_entityAttribute.Mana_Percent, 20, new Vector2(10, 15));
        this.AddRandomAttribute(e_entityAttribute.Strength, 20, new Vector2(2, 4));
        this.AddRandomAttribute(e_entityAttribute.Dexterity, 20, new Vector2(2, 4));
        this.AddRandomAttribute(e_entityAttribute.Vitality, 20, new Vector2(2, 4));
        this.AddRandomAttribute(e_entityAttribute.Damage, 20, new Vector2(6, 8));

        this.importanceOAttributefValue *= 2.3f;
        AttributeInitializer <TModuleType> .AddFixedAttribute(e_entityAttribute.Fast_Cast_Percent, new Vector2(0.8f / this.importanceOAttributefValue, 1.2f / this.importanceOAttributefValue), this);

        this.weight = 12;

        this.equipmentEmplacement = e_equipmentEmplacement.Both_Hand;
    }
Ejemplo n.º 6
0
    public void Initialize(Inventory <TModuleType> inventory, Transform transform, PlayerAttribute <TModuleType> playerAttri, AttributeInitializer <TModuleType> attributeInitializer)
    {
        this.genericTableOfLoot.InitializeAttributeInitializer(attributeInitializer);
        this.genericTableOfLoot.itemGenerator.InitializeGenerator(playerAttri);

        this.inventory = inventory;
        this.genericTableOfLoot.itemGenerator.Range = 5;
        this.trans = transform;

        this.SetGeneration();
        this.Generate();
        this.ItemsTableOfLootToInventory();
    }
Ejemplo n.º 7
0
 public void InitializeAttributeInitializer(AttributeInitializer <TModuleType> attri)
 {
     attributeInitializer = attri;
 }
Ejemplo n.º 8
0
 public void GenerateStuffAttributes(AInventory <TModuleType> aInventory, AttributeInitializer <TModuleType> attributeInitializer)
 {
     this.stuffGenerator.GenerateAttributes(aInventory, attributeInitializer);
 }