Sledgehammer: Difference between revisions

From PZwiki
No edit summary
(added CodeBox, Condition and other fixes/updates/adjustments)
Line 1: Line 1:
{{Languages}}
{{Languages}}
{{Header|The Game World|Items|Weapons|Melee weapons|type=Weapon|version=Version 41|incver=77}}
{{Header|The Game World|Items|Weapons|Melee weapons|type=Weapon|version=Version 41|incver=78.16}}
{{Infobox weapon
{{Infobox weapon
|display_name=Sledgehammer
|display_name=Sledgehammer
Line 13: Line 13:
|alternate_name2=Sledgehammer
|alternate_name2=Sledgehammer
|alternate_link2=
|alternate_link2=
|category=Weapon
<!--General-->
|category=Tool/Weapon
|weight=6
|weight=6
|function=Destroy walls
|function=Destroy walls
|equipped=Two-handed
|equipped=Two-handed
|condition_max=10
|attachment_type=BigBlade
|skill_type=Blunt
<!--DAMAGE-->
|type=Blunt
|type=Blunt
|min_range=0.7
|min_range=0.7
|max_range=1.35
|max_range=1.35
|swing_time=4
|base_speed=0.9
|condition_max=10
|min_damage=2
|min_damage=2
|max_damage=3
|max_damage=3
|push_back=1
|push_back=1
|knockdown=3
|knockdown=3
<!--TECHNICAL-->
|class_name=Base.Sledgehammer<br>Base.Sledgehammer2
|class_name=Base.Sledgehammer<br>Base.Sledgehammer2
}}
}}
Line 32: Line 37:
==Usage==
==Usage==
===Weapon===
===Weapon===
The sledgehammer has one of the highest average and maximum damage of all weapons, but has the longest swing time among all melee weapons. The sledgehammer is one of the few weapons that can hit 3 zombies at once (for comparison, a [[Baseball Bat|baseball bat]] can only hit 2 zombies at once), but it must be used carefully as it generates a lot of exhaustion. Notably, the character is unable to swing the sledgehammer when [[Moodles#Endurance|exhausted]].
The sledgehammer has one of the highest average and maximum damage of all weapons, but has a very slow attack speed. The sledgehammer is one of the few weapons that can hit 3 [[zombie]]s at once (with multi-hit enabled), for comparison, a [[Baseball Bat|baseball bat]] can only hit 2 zombies at once. It is heavy, must be equipped in two hands, and will quickly [[Moodles#Endurance|exhaust]] the user, and cannot be used once the character is exhausted.  


===Breaking doors===
===Breaking doors===
The sledgehammer is very effective at breaking [[Door|doors]], dealing 40 damage to them, compared to an [[Axe|Axe]] dealing 35 damage. The destroy function can also be used to destroy doors instantly.
The sledgehammer is very effective at breaking [[door]]s, dealing 40 damage to them, compared to an [[axe]] dealing 35 damage. Alternatively, the destroy function can be used to destroy doors instantly.


===Chopping trees===
===Chopping trees===
The sledgehammer is better at chopping down trees than most melee weapons, dealing 10 damage, but still not as effective as the [[Axe]] which deals 35 damage.
The sledgehammer is better at chopping down trees than most melee weapons, dealing 10 damage, but still not as effective as the [[axe]] which deals 35 damage.


===Destruction of tiles===
===Destruction of tiles===
Destroying tiles, such as walls, doors and other miscellaneous objects, is a function exclusive to the sledgehammer. To destroy blocks, click "Destroy" on the right-click menu while having the Sledgehammer equipped. A red box will appear, highlighting the block you are about to destroy.
Destroying [[tiles]], such as walls, doors and other miscellaneous objects, is a function exclusive to the sledgehammer. To destroy tiles, click "Destroy" on the {{key|{{abbr|RMB|Right Mouse Button}}}} contextual menu while having the sledgehammer equipped. A red box will appear, highlighting the tile to destroy.


==Condition==
==Condition==
The sledgehammer is a blunt weapon, therefore being influenced by the blunt skills: accuracy, guard and maintenance. The sledgehammer's durability is exceptionally high and it takes a long time to break. The sledgehammer has a 1 in 40 chance of losing durability per hit.
The sledgehammer has a maximum condition of 10. Its rate of degradation is influenced by the [[Skills|long blunt]] and [[Skills|maintenance]] skills. The chance of losing [[durability]] can be simplified to the following formula: <code>1 in (40 + maintenanceMod &times; 2)</code>. Where "maintenanceMod" is calculated using the long blunt and maintenance skills.<br>
Below is an example of the chance of losing durability at varying levels of the [[Skills|maintenance]] and [[Skills|long blunt]] skills.
{{Durability weapon|40}}


===Repairing===
===Repairing===
It should be noted that repairing the sledgehammer makes following repairs less likely to succeed and can, if repaired numerous times, cause reduced durability instead of increased.
{{Fixing weapon
{{Fixing weapon
|item=Sledgehammer
|item=Sledgehammer
Line 63: Line 71:
|scotchtapechance=95
|scotchtapechance=95
}}
}}
It should be noted that repairing the sledgehammer makes following repairs less likely to succeed and can, if repaired numerous times, cause reduced durability instead of increased.


==Distribution==
==Distribution==
Line 70: Line 76:


==Crafting==
==Crafting==
Due to the item being a blunt weapon, it can be used to smash a watermelon.
The sledgehammer can be used to smash a watermelon into chunks.
{{Crafting header|ing=2}}
{{Crafting header|ing=2}}
{{Crafting cooking|402|ing=2}}
{{Crafting cooking|402|ing=2}}
Line 76: Line 82:


==Code==
==Code==
'''''From items_weapons.txt (Project Zomboid directory/media/scripts/)'''''
{{CodeBox|
<pre>
===Item===
item Sledgehammer
[[File:Sledgehammer.png]] {{ID|Base.Sledgehammer}}<br>
{{CodeSnip
  | lang = java
  | line = true
  | start = 2868
  | source = items_weapons.txt
  | retrieved = true
  | version = 41
  | incver = 78.16
  | code =
    item Sledgehammer
{
{
    DisplayCategory = ToolWeapon,
    DisplayCategory = ToolWeapon,
Line 112: Line 128:
Icon = Sledgehamer,
Icon = Sledgehamer,
RunAnim = Run_Weapon2,
RunAnim = Run_Weapon2,
TwoHandWeapon = TRUE,
        TwoHandWeapon = TRUE,
BreakSound  =  SledgehammerBreak,
        BreakSound  =  SledgehammerBreak,
TreeDamage  =  10,
        TreeDamage  =  10,
MinDamage = 2,
        MinDamage = 2,
MaxDamage = 3,
        MaxDamage = 3,
MetalValue = 120,
        MetalValue = 120,
AlwaysKnockdown = TRUE,
        AlwaysKnockdown = TRUE,
CritDmgMultiplier = 2
        CritDmgMultiplier = 2,
BaseSpeed = 0.9,
        BaseSpeed = 0.9,
WeaponLength = 0.65,
      WeaponLength = 0.65,
RequiresEquippedBothHands = TRUE,
      RequiresEquippedBothHands = TRUE,
AttachmentType = BigBlade,
      AttachmentType = BigBlade,
Tags = Sledgehammer,
        Tags = Sledgehammer,
}
}
}}


item Sledgehammer2
[[File:Sledgehammer2.png]] {{ID|Base.Sledgehammer2}}<br>
{{CodeSnip
  | lang = java
  | line = true
  | start = 2917
  | source = items_weapons.txt
  | retrieved = true
  | version = 41
  | incver = 78.16
  | code =
item Sledgehammer2
     {
     {
         DisplayCategory = ToolWeapon,
         DisplayCategory = ToolWeapon,
Line 155: Line 182:
         HitSound = SledgehammerHit,
         HitSound = SledgehammerHit,
         HitFloorSound = SledgehammerHit,
         HitFloorSound = SledgehammerHit,
        SwingSound = SledgehammerSwing,
SwingSound = SledgehammerSwing,
         DoorHitSound = SledgehammerHit,
         DoorHitSound = SledgehammerHit,
         KnockdownMod = 3,
         KnockdownMod = 3,
Line 175: Line 202:
         Tags = Sledgehammer,
         Tags = Sledgehammer,
     }
     }
</pre>
}}
 
===Repair===
[[File:Sledgehammer.png]] {{ID|Base.Sledgehammer}}<br>
{{CodeSnip
  | lang = java
  | line = true
  | start = 194
  | source = fixing.txt
  | retrieved = true
  | version = 41
  | incver = 78.16
  | code =
    fixing Fix Sledgehammer
    {
      Require : Sledgehammer,
 
      Fixer : Woodglue=2; Woodwork=2,
      Fixer : DuctTape=2,
      Fixer : Glue=3,
      Fixer : Scotchtape=4,
    }
}}
 
[[File:Sledgehammer2.png]] {{ID|Base.Sledgehammer2}}<br>
{{CodeSnip
  | lang = java
  | line = true
  | start = 204
  | source = fixing.txt
  | retrieved = true
  | version = 41
  | incver = 78.16
  | code =
    fixing Fix Sledgehammer2
    {
      Require : Sledgehammer2,
 
      Fixer : Woodglue=2; Woodwork=2,
      Fixer : DuctTape=2,
      Fixer : Glue=3,
      Fixer : Scotchtape=4,
    }
}}
}}


==History==
==History==
Line 190: Line 261:


==Gallery==
==Gallery==
[[File:Sledgehammer-Article-Image1.png|center|(Left) Showing the Destroy function on the sledgehammer. (Right) Showing the destruction of a wall.]]
<gallery>
Sledgehammer-Article-Image1.png|(Left) Showing the Destroy function on the sledgehammer. (Right) Showing the destruction of a wall.
<!--TODO: Sledgehammer2_model.png|The model of one of the sledgehammer variants.-->
</gallery>


{{Navbox equipment}}
{{Navbox equipment}}

Revision as of 16:15, 31 December 2023

Sledgehammer
Sledgehammer
Sledgehammer Sledgehammer
General
Category Tool/Weapon
Encumbrance
Heavy Load
6
Function Destroy walls
Equipped Two-handed
Condition max. 10
Skill Long Blunt
Attachment Back
Damage
Type Blunt
Attack speed 0.9
Range 0.7–1.35 tiles
Damage 2–3
Knockback 1
Knockdown 3
Technical details
Base ID Base.Sledgehammer
Base.Sledgehammer2

A sledgehammer is a heavy, two-handed, blunt melee weapon.

Usage

Weapon

The sledgehammer has one of the highest average and maximum damage of all weapons, but has a very slow attack speed. The sledgehammer is one of the few weapons that can hit 3 zombies at once (with multi-hit enabled), for comparison, a baseball bat can only hit 2 zombies at once. It is heavy, must be equipped in two hands, and will quickly exhaust the user, and cannot be used once the character is exhausted.

Breaking doors

The sledgehammer is very effective at breaking doors, dealing 40 damage to them, compared to an axe dealing 35 damage. Alternatively, the destroy function can be used to destroy doors instantly.

Chopping trees

The sledgehammer is better at chopping down trees than most melee weapons, dealing 10 damage, but still not as effective as the axe which deals 35 damage.

Destruction of tiles

Destroying tiles, such as walls, doors and other miscellaneous objects, is a function exclusive to the sledgehammer. To destroy tiles, click "Destroy" on the RMB contextual menu while having the sledgehammer equipped. A red box will appear, highlighting the tile to destroy.

Condition

The sledgehammer has a maximum condition of 10. Its rate of degradation is influenced by the long blunt and maintenance skills. The chance of losing durability can be simplified to the following formula: 1 in (40 + maintenanceMod × 2). Where "maintenanceMod" is calculated using the long blunt and maintenance skills.
Below is an example of the chance of losing durability at varying levels of the maintenance and long blunt skills.

For how this is calculated, see: Durability
Maintenance skill Weapon skill Durability lower chance
0 0 1/40 (3%)
0 4 1/42 (2%)
0 8 1/44 (2%)
4 0 1/44 (2%)
8 0 1/48 (2%)
4 4 1/46 (2%)
4 8 1/48 (2%)
8 8 1/52 (2%)
10 10 1/54 (2%)

Repairing

It should be noted that repairing the sledgehammer makes following repairs less likely to succeed and can, if repaired numerous times, cause reduced durability instead of increased.

Repair Sledgehammer
Woodglue.png
Potentially repairs: 55%
Chance of success: 100%
DuctTape.png
Potentially repairs: 20%
Chance of success: 95%
Glue.png
Potentially repairs: 10%
Chance of success: 95%
Scotchtape.png
Potentially repairs: 10%
Chance of success: 95%

Distribution

Sledgehammers are usually found in crates and metal shelves. Locations such as warehouses, hardware stores, constrution sites, and industrial facilities are prime locations for finding a sledgehammer. Rarely, a sledgehammer can be found on the road near a pothole and traffic cones. Sledgehammers also have a rare chance of spawning in weapon containers within survivor houses.

Crafting

The sledgehammer can be used to smash a watermelon into chunks.

Product XP gained Skill(s) Recipe Ingredient 1 Ingredient 2
WatermelonSmashed.png
Watermelon Chunks x5
0.75 Cooking none
(keep)
Watermelon.png
Watermelon
(consumed)

Code

Code icon.png Code snippet! This section contains source code from Project ZomboidShow / Hide

Item

Sledgehammer.png Base.Sledgehammer
Source: ProjectZomboid\media\scripts\items_weapons.txt

Retrieved: Build 41.78.16
item Sledgehammer
	{
	    DisplayCategory = ToolWeapon,
		MaxRange	=	1.35,
		WeaponSprite	=	SledgeHammer,
		MinAngle	=	0.8,
		Type	=	Weapon,
		MinimumSwingTime	=	4,
		EnduranceMod	=	4,
		KnockBackOnNoDeath	=	TRUE,
		SwingAmountBeforeImpact	=	0.04,
		Categories	=	Blunt,
		ConditionLowerChanceOneIn	=	40,
		Weight	=	6,
		SplatNumber	=	3,
		PushBackMod	=	1,
		SubCategory	=	Swinging,
		ConditionMax	=	10,
		MaxHitCount	=	3,
		DoorDamage	=	40,
		IdleAnim	=	Idle_Weapon2,
		CantAttackWithLowestEndurance	=	TRUE,
		SwingAnim	=	Heavy,
		DisplayName	=	Sledgehammer,
		MinRange	=	0.7,
		SwingTime	=	2,
		HitSound = SledgehammerHit,
		HitFloorSound = SledgehammerHit,
		SwingSound = SledgehammerSwing,
		DoorHitSound	=	SledgehammerHit,
		KnockdownMod	=	3,
		SplatBloodOnNoDeath	=	FALSE,
		Icon	=	Sledgehamer,
		RunAnim	=	Run_Weapon2,
        TwoHandWeapon = TRUE,
        BreakSound  =   SledgehammerBreak,
        TreeDamage  =   10,
        MinDamage	=	2,
        MaxDamage	=	3,
        MetalValue = 120,
        AlwaysKnockdown = TRUE,
        CritDmgMultiplier = 2,
        BaseSpeed = 0.9,
      	WeaponLength = 0.65,
      	RequiresEquippedBothHands = TRUE,
      	AttachmentType = BigBlade,
        Tags = Sledgehammer,
	}

Sledgehammer2.png Base.Sledgehammer2
Source: ProjectZomboid\media\scripts\items_weapons.txt

Retrieved: Build 41.78.16
item Sledgehammer2
    {
        DisplayCategory = ToolWeapon,
        MaxRange	=	1.35,
        WeaponSprite	=	SledgeHammer02,
        MinAngle	=	0.8,
        Type	=	Weapon,
        MinimumSwingTime	=	4,
        EnduranceMod	=	4,
        KnockBackOnNoDeath	=	TRUE,
        SwingAmountBeforeImpact	=	0.04,
        Categories	=	Blunt,
        ConditionLowerChanceOneIn	=	40,
        Weight	=	6,
        SplatNumber	=	3,
        PushBackMod	=	1,
        SubCategory	=	Swinging,
        ConditionMax	=	10,
        MaxHitCount	=	3,
        DoorDamage	=	40,
        IdleAnim	=	Idle_Weapon2,
        CantAttackWithLowestEndurance	=	TRUE,
        SwingAnim	=	Heavy,
        DisplayName	=	Sledgehammer,
        MinRange	=	0.7,
        SwingTime	=	2,
        HitSound = SledgehammerHit,
        HitFloorSound = SledgehammerHit,
		SwingSound = SledgehammerSwing,
        DoorHitSound = SledgehammerHit,
        KnockdownMod	=	3,
        SplatBloodOnNoDeath	=	FALSE,
        Icon	=	Sledgehammer2,
        RunAnim	=	Run_Weapon2,
        TwoHandWeapon = TRUE,
        BreakSound  =   SledgehammerBreak,
        TreeDamage  =   10,
        MetalValue = 120,
        MinDamage	=	2,
        MaxDamage	=	3,
        AlwaysKnockdown = TRUE,
        CritDmgMultiplier = 2,
        BaseSpeed = 0.9,
        WeaponLength = 0.65,
        RequiresEquippedBothHands = TRUE,
        AttachmentType = BigBlade,
        Tags = Sledgehammer,
    }

Repair

Sledgehammer.png Base.Sledgehammer
Source: ProjectZomboid\media\scripts\fixing.txt

Retrieved: Build 41.78.16
fixing Fix Sledgehammer
    {
       Require : Sledgehammer,

       Fixer : Woodglue=2; Woodwork=2,
       Fixer : DuctTape=2,
       Fixer : Glue=3,
       Fixer : Scotchtape=4,
    }

Sledgehammer2.png Base.Sledgehammer2
Source: ProjectZomboid\media\scripts\fixing.txt

Retrieved: Build 41.78.16
fixing Fix Sledgehammer2
    {
       Require : Sledgehammer2,

       Fixer : Woodglue=2; Woodwork=2,
       Fixer : DuctTape=2,
       Fixer : Glue=3,
       Fixer : Scotchtape=4,
    }

History

Alpha
Build 26 The sledgehammer will lose condition when used to destroy things.
RC 2.9.8a Melee weapons debuffed.
0.2.0a Sledgehammer added

Gallery