Click code cleanup
Created by: wild-billy
Adds preAttack()
, allowing items to interact independent of attackby()
(eg guns, syringes, etc).
Adds attackArmed()
, allowing mobs to make modifications to attacks (eg hulks hit harder).
Cleans up the adjacency checks and adds canTouch()
and isAbleBodied()
Removed click delay and adds an attack delay system in attackArmed() and UnarmedAttack(), which only applies to atoms with delayAttacks
set. It uses the attackDelay
var on items if the user is armed, otherwise it uses the user's attackDelayUnarmed
var.
This is cleaner and adds a new dimension to combat balance, allowing weapons to have different attack rates (eg kitchen knives can be faster than fireaxes) in the future.
Also allows users to have different unarmed attack speeds (eg hyperzine could increase it)
Improved organization by removing the _onclick
folder and moving objects' interaction code to their own files (eg mob code in mob.dm, atom code in atoms.dm, airlock code in airlock.dm).
Tested and working as far as i know, but this is a lot of changes so the more testing the better.