Ejemplo n.º 1
0
ItemTool::ItemTool(float_t damageVsEntity, ToolMaterial material, std::set<Block*>& blocks) :
                   toolMaterial(material), effectiveBlocks(blocks) {
    setMaxStackSize(1);
    setMaxDamage(material.getMaxUses());
    this->damageVsEntity = damageVsEntity + material.getDamageVsEntity();
    efficiency = material.getEfficiency();
}
Ejemplo n.º 2
0
PickaxeItem::PickaxeItem(const std::string &name, short id) : Item(name, id)
{
	setCategory(CreativeItemCategory::TOOLS);
	setMaxStackSize(1);
	setMaxDamage(2000);
	setHandEquipped();
}
Ejemplo n.º 3
0
BasicItem::BasicItem(int itemId):
	GalacticraftItem("basicItem", itemId) {
	creativeCategory = 3;
	setMaxDamage(0);
	setStackedByData(false);
	
	initIcons();
}
Ejemplo n.º 4
0
ToolItem::ToolItem(const std::string& name, short id, float damage, Item::Tier tier, std::vector<Block*> blocks)
    : Item(name, id) {
    
    toolMaterial = &tier;
    validBlocks = blocks;
    maxStackSize = 1;
    setMaxDamage(tier.maxUses);
    efficiencyOnProperMaterial = tier.efficiencyOnProperMaterial;
    damageVsEntity = damage + tier.damageVsEntity;
}
Ejemplo n.º 5
0
ItemCloth(int ItemCloth::i) 
{
        super(i);
        setMaxDamage(0);
        setHasSubtypes(true);
}
Ejemplo n.º 6
0
ItemFishingRod(int ItemFishingRod::i) 
{
        super(i);
        setMaxDamage(64);
}
void WeaponObjectImplementation::updateCraftingValues(CraftingValues* values, bool firstUpdate) {
	/*
	 * Incoming Values:					Ranges:
	 * mindamage						Differs between weapons
	 * maxdamage
	 * attackspeed
	 * woundchance
	 * roundsused
	 * hitpoints
	 * zerorangemod
	 * maxrange
	 * maxrangemod
	 * midrange
	 * midrangemod
	 * charges
	 * attackhealthcost
	 * attackactioncost
	 * attackmindcost
	 */
	float value = 0.f;
	setMinDamage(MAX(values->getCurrentValue("mindamage"), 0));
	setMaxDamage(MAX(values->getCurrentValue("maxdamage"), 0));

	setAttackSpeed(values->getCurrentValue("attackspeed"));
	setHealthAttackCost((int)values->getCurrentValue("attackhealthcost"));
	setActionAttackCost((int)values->getCurrentValue("attackactioncost"));
	setMindAttackCost((int)values->getCurrentValue("attackmindcost"));

	if (isJediWeapon()) {
		setForceCost((int)values->getCurrentValue("forcecost"));
		setBladeColor(31);
	}

	value = values->getCurrentValue("woundchance");
	if(value != CraftingValues::VALUENOTFOUND)
		setWoundsRatio(value);

	//value = craftingValues->getCurrentValue("roundsused");
	//if(value != DraftSchematicValuesImplementation::VALUENOTFOUND)
		//_this.getReferenceUnsafeStaticCast()->set_______(value);

	value = values->getCurrentValue("zerorangemod");
	if(value != CraftingValues::VALUENOTFOUND)
		setPointBlankAccuracy((int)value);

	value = values->getCurrentValue("maxrange");
	if(value != CraftingValues::VALUENOTFOUND)
		setMaxRange((int)value);

	value = values->getCurrentValue("maxrangemod");
	if(value != CraftingValues::VALUENOTFOUND)
		setMaxRangeAccuracy((int)value);

	value = values->getCurrentValue("midrange");
	if(value != CraftingValues::VALUENOTFOUND)
		setIdealRange((int)value);

	value = values->getCurrentValue("midrangemod");
	if(value != CraftingValues::VALUENOTFOUND)
		setIdealAccuracy((int)value);

	//value = craftingValues->getCurrentValue("charges");
	//if(value != CraftingValues::VALUENOTFOUND)
	//	setUsesRemaining((int)value);

	value = values->getCurrentValue("hitpoints");
	if(value != CraftingValues::VALUENOTFOUND)
		setMaxCondition((int)value);

	setConditionDamage(0);
}