Commit for Giacom:

Breaking bottles over people's heads!
- The bottle will be destroyed and a broken bottle will replace the old bottle
- There is a chance for a glass shard to be created
- The regents of the bottle get splashed onto the mob who got hit
- This affects alcoholic bottles, not to be confused with pill bottles or chemistry bottles.
- - Technically milk cartons and lime juice cartons, so they break as if they're glass.

Names in the PDA list are now ordered alphabetically.

Changelog updated

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3998 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-07-06 04:31:35 +00:00
parent 00a4219bec
commit fa1d2bb873
9 changed files with 347 additions and 7 deletions

View File

@@ -1872,3 +1872,12 @@ proc/get_mob_with_client_list()
proc/worldtime2text()
return "[round(world.time / 36000)+12]:[(world.time / 600 % 60) < 10 ? add_zero(world.time / 600 % 60, 1) : world.time / 600 % 60]"
/atom/proc/transfer_fingerprints_to(var/atom/A)
if(!istype(A.fingerprints,/list))
A.fingerprints = list()
if(!istype(A.fingerprintshidden,/list))
A.fingerprintshidden = list()
A.fingerprints |= fingerprints //detective
A.fingerprintshidden |= fingerprintshidden //admin
A.fingerprintslast = fingerprintslast

View File

@@ -347,7 +347,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
var/count = 0
if (!toff)
for (var/obj/item/device/pda/P in PDAs)
for (var/obj/item/device/pda/P in sortList(PDAs))
if (!P.owner||P.toff||P == src) continue
dat += "<li><a href='byond://?src=\ref[src];choice=Message;target=\ref[P]'>[P]</a>"
if (istype(cartridge, /obj/item/weapon/cartridge/syndicate) && !istype(P, /obj/item/device/pda/ai))

View File

@@ -524,6 +524,7 @@
istype(W, /obj/item/weapon/scalpel) || \
istype(W, /obj/item/weapon/kitchen/utensil/knife) || \
istype(W, /obj/item/weapon/shard) || \
istype(W, /obj/item/weapon/broken_bottle) || \
istype(W, /obj/item/weapon/reagent_containers/syringe) || \
istype(W, /obj/item/weapon/kitchen/utensil/fork) && W.icon_state != "forkloaded" || \
istype(W, /obj/item/weapon/twohanded/fireaxe) \

View File

@@ -2732,12 +2732,135 @@
icon_state = "water_cup_e"
///////////////////////////////////////////////Alchohol bottles! -Agouri //////////////////////////
//Notes by Darem: Functionally identical to regular drinks. The only difference is that the default bottle size is 100.
//Functionally identical to regular drinks. The only difference is that the default bottle size is 100. - Darem
//Bottles now weaken and break when smashed on people's heads. - Giacom
/obj/item/weapon/reagent_containers/food/drinks/bottle
amount_per_transfer_from_this = 10
volume = 100
item_state = "beer" //Generic held-item sprite until unique ones are made.
// Bottles only last for one attack before breaking and becoming broken bottles
// Force is also part of the duration calculation. Meaning if you make a small bottle then give it a small force
// so it isn't too strong.
force = 15
var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target as mob, mob/living/user as mob)
//Creates a shattering noise and replaces the bottle with a broken_bottle
user.drop_item()
var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(user)
if(prob(33))
new/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('drinks.dmi', src.icon_state)
I.Blend(B.broken_outline, ICON_OVERLAY, rand(5), 1)
I.SwapColor(rgb(255, 0, 220, 255), rgb(0, 0, 0, 0))
B.icon = I
playsound(src, "shatter", 70, 1)
user.put_in_active_hand(B)
src.transfer_fingerprints_to(B)
del(src)
/obj/item/weapon/reagent_containers/food/drinks/bottle/attack(mob/living/target as mob, mob/living/user as mob)
if(!target)
return
if(user.a_intent != "hurt" || user == target)
return ..()
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.
var/armor_duration = 0 //The more force the bottle has, the longer the duration.
//Calculating duration and calculating damage.
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/headarmor = 0 // Target's head armour
armor_block = H.run_armor_check(affecting, "melee") // For normal attack damage
//If they have a hat/helmet and the user is targeting their head.
if(istype(H.head, /obj/item/clothing/head) && affecting == "head")
// If their head has an armour value, assign headarmor to it, else give it 0.
if(H.head.armor["melee"])
headarmor = H.head.armor["melee"]
else
headarmor = 0
else
headarmor = 0
//Calculate the weakening duration for the target.
armor_duration = (duration - headarmor) + force
else
//Only humans can have armour, right?
armor_block = target.run_armor_check(affecting, "melee")
if(affecting == "head")
armor_duration = duration + force
armor_duration /= 10
//Apply the damage!
target.apply_damage(force, BRUTE, affecting, armor_block)
// You are going to knock someone out for longer if they are not wearing a helmet.
if(affecting == "head" && istype(target, /mob/living/carbon/))
//Display an attack message.
for(var/mob/O in viewers(user, null))
O.show_message(text("\red <B>[target] has been hit over the head with a bottle of [src.name], by [user]!</B>"), 1)
//Weaken the target for the duration that we calculated and divide it by 5.
if(armor_duration)
target.apply_effect(min(armor_duration, 10) , WEAKEN) // Never weaken more than a flash!
else
//Default attack message and don't weaken the target.
for(var/mob/O in viewers(user, null))
O.show_message(text("\red <B>[target] has been attacked with a bottle of [src.name], by [user]!</B>"), 1)
//Attack logs
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has attacked [target.name] ([target.ckey]) with a bottle!</font>")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been smashed with a bottle by [user.name] ([user.ckey])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [target.name] with a bottle. ([target.ckey])</font>")
//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)
return
//Keeping this here for now, I'll ask if I should keep it here.
/obj/item/weapon/broken_bottle
name = "Broken Bottle"
desc = "A bottle with a sharp broken bottom."
icon = 'drinks.dmi'
icon_state = "broken_bottle"
force = 9.0
throwforce = 5.0
throw_speed = 3
throw_range = 5
item_state = "beer"
//item_state - Need to find a bottle sprite
var/icon/broken_outline = icon('drinks.dmi', "broken")
/obj/item/weapon/reagent_containers/food/drinks/bottle/gin
name = "Griffeater Gin"
desc = "A bottle of high quality gin, produced in the New London Space Station."

View File

@@ -30,7 +30,7 @@
aiPDA = new/obj/item/device/pda/ai(src)
aiPDA.owner = name
aiPDA.ownjob = "AI"
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
aiPDA.name = "AI - " + name + " (" + aiPDA.ownjob + ")"
if (istype(loc, /turf))
verbs.Add(/mob/living/silicon/ai/proc/ai_call_shuttle,/mob/living/silicon/ai/proc/ai_camera_track, \

View File

@@ -16,7 +16,7 @@
if(aiPDA && aiPDA.name != name)
aiPDA.owner = name
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
aiPDA.name = "AI - " + name + " (" + aiPDA.ownjob + ")"
if (src.malfhack)
if (src.malfhack.aidisabled)