Jump to content

# Search the Community

Showing results for tags 'spears'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• News & Announcements
• News
• Project Zomboid
• PZ Updates
• General Discussions
• Bug Reports
• PZ Support
• PZ Multiplayer
• PZ Community & Creativity
• PZ Suggestions
• PZ Modding
• Tutorials & Resources
• Mods
• Items
• Mapping
• Mod Ideas and Requests
• General Games Development
• Indie Scene
• Other Discussions
• General Discussion
• Forum Games & Activities

• 0 Comments

• 0 Replies

• 0 Views

Found 3 results

1. ## Spearcrafting Bug

The way the formula that calculates the final condition for a spear with an additional weapon attached to it is causing unintended behavior. Spears with attachments never receive full condition upon crafting even if both weapons used in the crafting are in full condition. The highest amount of durability received is usually about half of the maximum even when both weapons used to craft it are in maximum condition themselves. The culprit are the following lines inside recipecode.lua: The problem is that the base crafted spear has a lower maximum condition than all of the spears with attachments, the same being also true for many of the blades used, yet the formula uses direct additions and subtractions instead of ratios. The ideal solution would be instead to take the proportion of the condition of the spear in relation to it's max condition [conditionMax = items:get(i):getCondition() / items:get(i):getConditionMax()], then do the same for the blade [conditionMax = conditionMax - math.abs( items:get(i):getCondition() / items:get(i):getConditionMax() - 1 )] and use the result to multiply for the maximum condition of the final spear [conditionMax = result:getConditionMax() * conditionMax] in order not to have inconsistencies while converting between different maximum conditions.
2. ## Where is the spears logic stored?

Hey all, I'm trying to get a look at how the spear checks and functions work. Does anyone know what classes I should be looking in? I've been running laps through HandWeapon, IsoGameCharacter, IsoPlayer etc but can't find it for the life of me. I'm specifically looking for how the sprint charge and head stab are determined and handled. I'm a Java & decompiling noob so I'm not sure how to just follow the usages when I see stuff that looks related. Any tips much appreciated. Edit: Nevermind, found it! Was right in front of me the whole time (SwipeStatePlayer and IsoPlayer if you're looking).
3. ## [B41.68] Spear critical bonus modification proposition

Here is my interpretation of the condition for the famous "high spear critical chances" as RE from IsoPlayer::pressedAttack(boolean) --spear +30% crit: this = IsoPlayer float var8 = IsoUtils.DistanceTo(var11.x, var11.y, this.x, this.y); this.setVariable("TargetDist", var8); int var9 = this.calculateCritChance(var11); if (var11 instanceof IsoZombie) { IsoZombie var10 = this.getClosestZombieToOtherZombie((IsoZombie)var11); if (!this.attackVars.bAimAtFloor //not aim floor && (double)var8 > 1.25D //target must be further than 1.25 "meters" && var4 == WeaponType.spear //weapon is spear && (var10 == null || (double)IsoUtils.DistanceTo(var11.x, var11.y, var10.x, var10.y) > 1.7D) //closestZombie from targetZombie is further than 1.7 meters from targetZombie ) { if (!GameClient.bClient || this.isLocalPlayer()) { this.setAttackType("overhead"); //go go spear in the head my boy ! } var9 += 30; } } Here is my proposition for correction modification of the decision algorithm : Do not take into account the closest Z to my target. But take into account the closest Z to me that I can detect. float var8 = IsoUtils.DistanceTo(var11.x, var11.y, this.x, this.y); this.setVariable("TargetDist", var8); int var9 = this.calculateCritChance(var11); if (var11 instanceof IsoZombie) { IsoZombie var10 = this.getClosestZombieThatisNotThatZombie((IsoZombie)var11); //get closestZombie to me, that I can detect, except targetZombie if (!this.attackVars.bAimAtFloor //not aim floor && (double)var8 > 1.25D //target is further than 1.25 "meters" && var4 == WeaponType.spear //weapon is spear && (var10 == null || (double)IsoUtils.DistanceTo(this.x, this.y, var10.x, var10.y) > 1.7D) //if that other "closestZombie" is far enough from me I can safely headshot with my spear ) { if (!GameClient.bClient || this.isLocalPlayer()) { this.setAttackType("overhead"); } var9 += 30; } }
×
×
• Create New...