Okay shards converted to pool usage now.

Conflicts:
	code/game/machinery/computer/arcade.dm
	code/game/machinery/doors/windowdoor.dm
	code/game/machinery/telecomms/traffic_control.dm
	code/game/objects/structures/displaycase.dm
	code/modules/mining/mine_turfs.dm
	code/modules/reagents/reagent_containers/food/drinks/drinkingglass.dm
This commit is contained in:
ESwordTheCat
2014-04-07 10:59:32 +08:00
committed by ZomgPonies
parent 2ff6d65212
commit c43652b33a
29 changed files with 216 additions and 101 deletions
+1 -1
View File
@@ -826,7 +826,7 @@
if (src.stat & BROKEN)
user << "\blue The broken glass falls out."
var/obj/structure/computerframe/A = new /obj/structure/computerframe(src.loc)
new /obj/item/weapon/shard(src.loc)
getFromPool(/obj/item/weapon/shard, loc)
var/obj/item/weapon/circuitboard/pandemic/M = new /obj/item/weapon/circuitboard/pandemic(A)
for (var/obj/C in src)
C.loc = src.loc
@@ -18,7 +18,7 @@
var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(user.loc)
user.put_in_active_hand(B)
if(prob(33))
new/obj/item/weapon/shard(target.loc) // Create a glass shard at the target's location!
getFromPool(/obj/item/weapon/shard, target.loc) // Create a glass shard at the target's location!
B.icon_state = src.icon_state
var/icon/I = new('icons/obj/drinks.dmi', src.icon_state)
@@ -6,6 +6,80 @@
icon_state = "glass_empty"
amount_per_transfer_from_this = 10
volume = 50
g_amt = 500
proc/smash(mob/living/target as mob, mob/living/user as mob)
//Creates a shattering noise and replaces the drinking glass with a glass shard
user.drop_item()
var/obj/item/weapon/shard/S = getFromPool(/obj/item/weapon/shard, user.loc)
user.put_in_active_hand(S)
playsound(src, "shatter", 70, 1)
user.put_in_active_hand(S)
src.transfer_fingerprints_to(S)
del(src)
attack(mob/living/target as mob, mob/living/user as mob)
if(!target)
return
if(user.a_intent != "hurt")
return ..()
force = 5
var/datum/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
var/armor_block = 0 //Get the target's armour values for normal attack damage.
//Calculating damage.
if(ishuman(target))
var/mob/living/carbon/human/H = target
armor_block = H.run_armor_check(affecting, "melee") // For normal attack damage
else
//Only humans can have armour, right?
armor_block = target.run_armor_check(affecting, "melee")
//Apply the damage!
target.apply_damage(force, BRUTE, affecting, armor_block)
if(affecting == "head" && istype(target, /mob/living/carbon/))
//Display an attack message.
for(var/mob/O in viewers(user, null))
if(target != user) O.show_message(text("\red <B>[target] has been hit over the head with a [src.name], by [user]!</B>"), 1)
else O.show_message(text("\red <B>[target] hit himself with a [src.name] on the head!</B>"), 1)
else
//Default attack message
for(var/mob/O in viewers(user, null))
if(target != user) O.show_message(text("\red <B>[target] has been attacked with a [src.name], by [user]!</B>"), 1)
else O.show_message(text("\red <B>[target] has attacked himself with a [src.name]!</B>"), 1)
//Attack logs
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has attacked [target.name] ([target.ckey]) with a drinking glass!</font>")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been smashed with a drinking glass by [user.name] ([user.ckey])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [target.name] with a drinking glass. ([target.ckey])</font>")
if(!iscarbon(user))
target.LAssailant = null
else
target.LAssailant = user
//The reagents in the bottle splash all over the target, thanks for the idea Nodrak
if(src.reagents)
for(var/mob/O in viewers(user, null))
O.show_message(text("\blue <B>The contents of the [src] splashes all over [target]!</B>"), 1)
src.reagents.reaction(target, TOUCH)
//Finally, smash the bottle. This kills (del) the bottle.
src.smash(target, user)
on_reagent_change()
/*if(reagents.reagent_list.len > 1 )