Second commits.

This contains the changes to item_attack.dm
Obj/attackby() now follows a similar structure as mob/living/attackby. It calls attack_obj() (like attack() but for obj) which calls attacked_by (just like attack() does)
The use of the NOBLUDGEON flag changes a bit, it is now used to signify the item cannot be used as a melee weapon at all. No attack animation, no attack message. I've given this bitflag to many items that have an afterattack() so as to not both attack and do the special action (among those items: the rcd)

There's also the code changes to attacking machines: attacking any machine now give a proper message and a sound. And with this, I made more machines breakable (using a health var and the very little used BROKEN stat). Most notably, tables can now be attacked when on harm intent and be destroyed.

The newly destroyable machines have a take_damage() proc used by all sorts of attack (weapon, xeno, animal, hulk, mech melee, gun projectile, thrown items).

There's some more stuff in there, see the PR's description and comments.
This commit is contained in:
phil235
2016-04-24 20:37:00 +02:00
parent 0caa59b21a
commit b146131a34
54 changed files with 1480 additions and 1410 deletions
+13 -14
View File
@@ -93,7 +93,7 @@
if (!powered())
return
if(istype(W,/obj/item/weapon/card/id))
var/obj/item/weapon/card/id/I = usr.get_active_hand()
var/obj/item/weapon/card/id/I = user.get_active_hand()
if(istype(I) && !istype(inserted_id))
if(!user.drop_item())
return
@@ -112,12 +112,13 @@
if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W))
updateUsrDialog()
return
if(panel_open)
if(istype(W, /obj/item/weapon/crowbar))
empty_content()
default_deconstruction_crowbar(W)
return 1
..()
if(default_deconstruction_crowbar(W))
return
return ..()
/obj/machinery/mineral/ore_redemption/deconstruction()
empty_content()
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(obj/item/weapon/ore/O)
if(O.refined_type)
@@ -407,11 +408,9 @@
if(default_deconstruction_screwdriver(user, "mining-open", "mining", I))
updateUsrDialog()
return
if(panel_open)
if(istype(I, /obj/item/weapon/crowbar))
default_deconstruction_crowbar(I)
return 1
..()
if(default_deconstruction_crowbar(I))
return
return ..()
/obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer)
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in list("Two Survival Capsules", "Resonator", "Mining Drone", "Advanced Scanner")
@@ -767,8 +766,8 @@
icon_state = "door_electronics"
icon = 'icons/obj/module.dmi'
/obj/item/device/mine_bot_ugprade/afterattack(mob/living/simple_animal/hostile/mining_drone/M, mob/user)
if(!istype(M))
/obj/item/device/mine_bot_ugprade/afterattack(mob/living/simple_animal/hostile/mining_drone/M, mob/user, proximity)
if(!istype(M) || !proximity)
return
upgrade_bot(M, user)