Merge pull request #10700 from Ergovisavi/more_fire

Molotovs and a throw fix
This commit is contained in:
Jordie
2015-07-25 20:05:05 +10:00
6 changed files with 123 additions and 15 deletions

View File

@@ -30,6 +30,15 @@
time = 80
category = CAT_WEAPON
/datum/table_recipe/molotov
name = "Molotov"
result = /obj/item/weapon/reagent_containers/food/drinks/bottle/molotov
reqs = list(/obj/item/weapon/reagent_containers/glass/rag = 1,
/obj/item/weapon/reagent_containers/food/drinks/bottle = 1)
parts = list(/obj/item/weapon/reagent_containers/food/drinks/bottle = 1)
time = 80
category = CAT_WEAPON
/datum/table_recipe/stunprod
name = "Stunprod"
result = /obj/item/weapon/melee/baton/cattleprod

View File

@@ -11,14 +11,22 @@
var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
var/isGlass = 1 //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target, mob/living/user)
/obj/item/weapon/reagent_containers/food/drinks/bottle/throw_impact(atom/target,mob/thrower)
..(target,thrower)
SplashReagents(target)
smash(target,thrower,1)
return
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target, mob/living/user, ranged = 0)
//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.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!
var/new_location = get_turf(loc)
var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(new_location)
if(ranged)
B.loc = new_location
else
user.drop_item()
user.put_in_active_hand(B)
B.icon_state = src.icon_state
var/icon/I = new('icons/obj/drinks.dmi', src.icon_state)
@@ -26,8 +34,15 @@
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)
if(isGlass)
if(prob(33))
new/obj/item/weapon/shard(new_location)
playsound(src, "shatter", 70, 1)
else
B.name = "broken carton"
B.force = 0
B.throwforce = 0
B.desc = "A carton with the bottom half burst open. Might give you a papercut."
src.transfer_fingerprints_to(B)
qdel(src)
@@ -100,19 +115,23 @@
add_logs(user, target, "attacked", src)
//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("<span class='danger'>The contents of \the [src] splashes all over [target]!</span>"), 1)
src.reagents.reaction(target, TOUCH)
SplashReagents(target)
//Finally, smash the bottle. This kills (del) the bottle.
src.smash(target, user)
return
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/SplashReagents(var/mob/M)
if(src.reagents.total_volume)
for(var/mob/O in viewers(M, null))
O.show_message(text("<span class='danger'>The contents of \the [src] splashes all over [M]!</span>"), 1)
reagents.reaction(M, TOUCH)
reagents.clear_reagents()
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 = 'icons/obj/drinks.dmi'
@@ -243,3 +262,66 @@
item_state = "carton"
isGlass = 0
list_reagents = list("limejuice" = 100)
////////////////////////// MOLOTOV ///////////////////////
/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov
name = "molotov cocktail"
desc = "A throwing weapon used to ignite things, typically filled with an accelerant. Recommended highly by rioters and revolutionaries. Light and toss."
icon_state = "vodkabottle"
list_reagents = list()
var/list/accelerants = list( /datum/reagent/consumable/ethanol,/datum/reagent/fuel,/datum/reagent/clf3,/datum/reagent/phlogiston,
/datum/reagent/napalm,/datum/reagent/hellwater,/datum/reagent/toxin/plasma,/datum/reagent/toxin/spore_burning)
var/active = 0
/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/CheckParts()
var/obj/item/weapon/reagent_containers/food/drinks/bottle/B = locate() in contents
if(B)
icon_state = B.icon_state
B.reagents.copy_to(src,100)
if(!B.isGlass)
desc += " You're not sure if making this out of a carton was the brightest idea."
isGlass = 0
return
/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/throw_impact(atom/target,mob/thrower)
var/firestarter = 0
for(var/datum/reagent/R in reagents.reagent_list)
for(var/A in accelerants)
if(istype(R,A))
firestarter = 1
break
SplashReagents(target)
if(firestarter && active)
target.fire_act()
new /obj/effect/hotspot(get_turf(target))
..()
/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/attackby(obj/item/I, mob/user, params)
if(is_hot(I) && !active)
active = 1
user << "<span class='info'>You light \the [src] on fire.</span>"
overlays += fire_overlay
if(!isGlass)
spawn(50)
if(active)
var/counter
var/target = src.loc
for(counter = 0, counter<2, counter++)
if(istype(target, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = target
target = S.loc
if(istype(target, /atom))
var/atom/A = target
SplashReagents(A)
A.fire_act()
qdel(src)
/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/attack_self(mob/user)
if(active)
if(!isGlass)
user << "<span class='danger'>The flame's spread too far on it!</span>"
return
user << "<span class='info'>You snuff out the flame on \the [src].</span>"
overlays -= fire_overlay
active = 0

View File

@@ -153,11 +153,12 @@
dat += "Weed Killer: <A href='?src=\ref[src];create=wk;amount=1'>Make</A><A href='?src=\ref[src];create=wk;amount=5'>x5</A> ([50/efficiency])<BR>"
dat += "Pest Killer: <A href='?src=\ref[src];create=pk;amount=1'>Make</A><A href='?src=\ref[src];create=pk;amount=5'>x5</A> ([50/efficiency])<BR>"
dat += "</div>"
dat += "<h3>Leather:</h3>"
dat += "<h3>Leather and Cloth:</h3>"
dat += "<div class='statusDisplay'>"
dat += "Wallet: <A href='?src=\ref[src];create=wallet;amount=1'>Make</A> ([100/efficiency])<BR>"
dat += "Book bag: <A href='?src=\ref[src];create=bkbag;amount=1'>Make</A> ([200/efficiency])<BR>"
dat += "Plant bag: <A href='?src=\ref[src];create=ptbag;amount=1'>Make</A> ([200/efficiency])<BR>"
dat += "Rag: <A href='?src=\ref[src];create=rag;amount=1'>Make</A> ([200/efficiency])<BR>"
dat += "Mining satchel: <A href='?src=\ref[src];create=mnbag;amount=1'>Make</A> ([200/efficiency])<BR>"
dat += "Chemistry bag: <A href='?src=\ref[src];create=chbag;amount=1'>Make</A> ([200/efficiency])<BR>"
dat += "Botanical gloves: <A href='?src=\ref[src];create=gloves;amount=1'>Make</A> ([250/efficiency])<BR>"
@@ -275,6 +276,9 @@
if("chbag")
if (check_cost(200/efficiency)) return 0
else new/obj/item/weapon/storage/bag/chemistry(src.loc)
if("rag")
if (check_cost(200/efficiency)) return 0
else new/obj/item/weapon/reagent_containers/glass/rag(src.loc)
if("gloves")
if (check_cost(250/efficiency)) return 0
else new/obj/item/clothing/gloves/botanic_leather(src.loc)