Big Ol' Balloon Bombardment (#10734)

This was totally worth it.
This commit is contained in:
Wowzewow (Wezzy)
2020-12-10 00:54:34 -03:00
committed by GitHub
parent 4caa4a60b8
commit 758c05cc83
17 changed files with 278 additions and 92 deletions
-48
View File
@@ -1,48 +0,0 @@
/obj/item/latexballon
name = "latex glove"
desc = "A latex glove, usually used as a balloon."
icon_state = "latexballon"
item_state = "lgloves"
force = 0
throwforce = 0
w_class = ITEMSIZE_SMALL
throw_speed = 1
throw_range = 15
var/state
var/datum/gas_mixture/air_contents = null
/obj/item/latexballon/proc/blow(obj/item/tank/tank)
if (icon_state == "latexballon_bursted")
return
src.air_contents = tank.remove_air_volume(3)
icon_state = "latexballon_blow"
item_state = "latexballon"
/obj/item/latexballon/proc/burst()
if (!air_contents)
return
playsound(src, 'sound/weapons/gunshot/gunshot1.ogg', 100, 1)
icon_state = "latexballon_bursted"
item_state = "lgloves"
loc.assume_air(air_contents)
/obj/item/latexballon/ex_act(severity)
burst()
switch(severity)
if (1)
qdel(src)
if (2)
if (prob(50))
qdel(src)
/obj/item/latexballon/bullet_act()
burst()
/obj/item/latexballon/fire_act(datum/gas_mixture/air, temperature, volume)
if(temperature > T0C+100)
burst()
return
/obj/item/latexballon/attackby(obj/item/W as obj, mob/user as mob)
if (can_puncture(W))
burst()
+183 -23
View File
@@ -33,25 +33,25 @@
pickup_sound = 'sound/items/pickup/gloves.ogg'
/*
* Balloons
* Water Balloons
*/
/obj/item/toy/balloon
/obj/item/toy/waterballoon
name = "water balloon"
desc = "A translucent balloon. There's nothing in it."
icon_state = "waterballoon-e"
item_state = "balloon-empty"
item_state = "waterballoon-e"
drop_sound = 'sound/items/drop/rubber.ogg'
pickup_sound = 'sound/items/pickup/rubber.ogg'
/obj/item/toy/balloon/New()
/obj/item/toy/waterballoon/New()
var/datum/reagents/R = new/datum/reagents(10)
reagents = R
R.my_atom = src
/obj/item/toy/balloon/attack(mob/living/carbon/human/M as mob, mob/user as mob)
/obj/item/toy/waterballoon/attack(mob/living/carbon/human/M as mob, mob/user as mob)
return
/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
/obj/item/toy/waterballoon/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
if(!proximity) return
if (istype(A, /obj/structure/reagent_dispensers/watertank) && get_dist(src,A) <= 1)
A.reagents.trans_to_obj(src, 10)
@@ -60,7 +60,7 @@
src.update_icon()
return
/obj/item/toy/balloon/attackby(obj/O as obj, mob/user as mob)
/obj/item/toy/waterballoon/attackby(obj/O as obj, mob/user as mob)
if(istype(O, /obj/item/reagent_containers/glass))
if(O.reagents)
if(O.reagents.total_volume < 1)
@@ -77,7 +77,7 @@
src.update_icon()
return
/obj/item/toy/balloon/throw_impact(atom/hit_atom)
/obj/item/toy/waterballoon/throw_impact(atom/hit_atom)
if(src.reagents.total_volume >= 1)
src.visible_message("<span class='warning'>\The [src] bursts!</span>","You hear a pop and a splash.")
src.reagents.touch_turf(get_turf(hit_atom))
@@ -87,31 +87,191 @@
QDEL_IN(src, 5)
return
/obj/item/toy/balloon/update_icon()
/obj/item/toy/waterballoon/update_icon()
if(src.reagents.total_volume >= 1)
icon_state = "waterballoon"
item_state = "balloon"
else
icon_state = "waterballoon-e"
item_state = "balloon-empty"
item_state = icon_state
/obj/item/toy/syndicateballoon
name = "criminal balloon"
desc = "There is a tag on the back that reads \"FUK NT!11!\"."
/*
* Balloons
*/
#define BALLOON_NORMAL 0
#define BALLOON_BLOW 1
#define BALLOON_BURST 2
/obj/item/toy/balloon
name = "balloon"
desc_info = "You can fill it up with gas using a tank."
desc_fluff = "Thanks to the joint effort of the Research and Atmospherics teams, station enviroments have been set to allow balloons to float without helium. Look, it was the end of the month and we went under budget."
drop_sound = 'sound/items/drop/rubber.ogg'
pickup_sound = 'sound/items/pickup/rubber.ogg'
w_class = ITEMSIZE_HUGE
var/datum/gas_mixture/air_contents = null
var/status = 0 // 0 = normal, 1 = blow, 2 = burst
/obj/item/toy/balloon/attack_self(mob/user as mob)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(user.a_intent == I_HELP)
user.visible_message("<span class='notice'><b>\The [user]</b> pokes [src]!</span>","<span class='notice'>You poke [src]!</span>")
else if (user.a_intent == I_HURT)
user.visible_message("<span class='warning'><b>\The [user]</b> punches [src]!</span>","<span class='warning'>You punch [src]!</span>")
else if (user.a_intent == I_GRAB)
if(prob(66))
user.visible_message("<span class='warning'><b>\The [user]</b> attempts to pop [src]!</span>","<span class='warning'>You attempt to pop [src]!</span>")
else
user.visible_message("<span class='warning'><b>\The [user]</b> pops [src]!</span>","<span class='warning'>You pop [src]!</span>")
burst()
else
user.visible_message("<span class='notice'><b>\The [user]</b> lightly bats the [src].</span>","<span class='notice'>You lightly bat the [src].</span>")
/obj/item/toy/balloon/update_icon()
switch(status)
if(BALLOON_BURST)
if(("[initial(icon_state)]_burst") in icon_states(icon))
icon_state = "[initial(icon_state)]_burst"
item_state = icon_state
else
qdel(src) // Just qdel it if it doesn't have a burst state.
if(BALLOON_BLOW)
if(("[initial(icon_state)]_blow") in icon_states(icon)) //Only give blow icon_state if it has one. For those who can't be bothered to sprite. (Also a catch to prevent invisible sprites.)
icon_state = "[initial(icon_state)]_blow"
update_held_icon()
/obj/item/toy/balloon/proc/blow(obj/item/tank/T)
if(status == BALLOON_BURST)
return
else
src.air_contents = T.remove_air_volume(3)
status = BALLOON_BLOW
update_icon()
/obj/item/toy/balloon/proc/burst()
playsound(src, 'sound/weapons/gunshot/gunshot1.ogg', 100, 1)
status = BALLOON_BURST
update_icon()
if(air_contents)
loc.assume_air(air_contents)
/obj/item/toy/balloon/ex_act(severity)
burst()
switch(severity)
if(1)
qdel(src)
if(2)
if(prob(50))
qdel(src)
/obj/item/toy/balloon/bullet_act()
burst()
/obj/item/toy/balloon/fire_act(datum/gas_mixture/air, temperature, volume)
if(temperature > T0C+100)
burst()
return
/obj/item/toy/balloon/attackby(obj/item/W as obj, mob/user as mob)
if(can_puncture(W))
burst()
/obj/item/toy/balloon/latex
desc = "Leaves a starchy taste in your mouth after blowing into it."
icon_state = "latexballoon"
item_state = "latexballoon"
/obj/item/toy/balloon/latex/nitrile
desc = "I hope you aren't going to re-use these for medical purposes."
icon_state = "nitrileballoon"
item_state = "nitrileballoon"
/obj/item/toy/balloon/syndicate
name = "'criminal' balloon"
desc = "Across the balloon is printed: \"FUK CAPITALISM!11!\""
icon_state = "syndballoon"
item_state = "syndballoon"
drop_sound = 'sound/items/drop/rubber.ogg'
pickup_sound = 'sound/items/pickup/rubber.ogg'
w_class = ITEMSIZE_LARGE
/obj/item/toy/nanotrasenballoon
name = "nanotrasen balloon"
desc = "Across the balloon the following is printed: \"Man, I love NanoTrasen soooo much. I use only NT products. You have NO idea.\""
/obj/item/toy/balloon/nanotrasen
name = "'motivational' balloon"
desc = "Across the balloon is printed: \"Man, I love corporate soooo much. I use only brand name products. You have NO idea.\""
icon_state = "ntballoon"
item_state = "ntballoon"
w_class = ITEMSIZE_LARGE
drop_sound = 'sound/items/drop/rubber.ogg'
pickup_sound = 'sound/items/pickup/rubber.ogg'
/obj/item/toy/balloon/fellowship
name = "fellowship balloon"
desc = "Across the balloon is printed: \"Fellowship R Friends!\""
icon_state = "fellowshipballoon"
item_state = "fellowshipballoon"
/obj/item/toy/balloon/fellowshiphead
name = "fellowship head balloon"
desc = "Across the balloon is printed: \"Follow Fellows Forwards With The Fellowship!\""
icon_state = "fellowshipheadballoon"
item_state = "fellowshipheadballoon"
/obj/item/toy/balloon/contender
name = "contender balloon"
desc = "Across the balloon is printed: \"Contenders R Cool!\""
icon_state = "contenderballoon"
item_state = "contenderballoon"
/obj/item/toy/balloon/contenderhead
name = "contender head balloon"
desc = "Across the balloon is printed: \"Converge With Comrades in the Contenders!\""
icon_state = "contenderheadballoon"
item_state = "contenderheadballoon"
/obj/item/toy/balloon/bat
name = "giant bat balloon"
desc = "A large, kitschy balloon in the shape of a spooky bat with orange eyes."
desc_fluff = "There's a tag that reads: \"Apparition Halloween LLC.\""
icon_state = "batballoon"
/obj/item/toy/balloon/ghost
name = "giant ghost balloon"
desc = "Oh no, it's a ghost! Oh wait, it's just a kitschy balloon. Phew!"
desc_fluff = "There's a tag that reads: \"Apparition Halloween LLC.\""
icon_state = "ghostballoon"
/obj/item/toy/balloon/xmastree
name = "giant christmas tree balloon"
desc = "Mandatory at inter-generational christmas gatherings and office parties."
desc_fluff = "There's a tag that reads: \"On behalf of employee relations, the CCIA Department wishes you a happy non-denominational holiday season.\""
icon_state = "xmastreeballoon"
/obj/item/toy/balloon/candycane
name = "giant candy cane balloon"
desc = "Kris Kringle ain't got nothing on this candied confection."
desc_fluff = "There's a tag that reads: \"On behalf of employee relations, the CCIA Department wishes you a happy non-denominational holiday season.\""
icon_state = "candycaneballoon"
/obj/item/toy/balloon/color /// To color it, VV the 'color' var with a hex color code with the # included.
desc = "It's a plain little balloon. Comes in many colors!"
icon_state = "colorballoon"
item_state = "colorballoon"
build_from_parts = TRUE
worn_overlay = "string"
randpixel = 5
/obj/item/toy/balloon/color/Initialize()
. = ..()
if(build_from_parts)
color = pick(COLOR_BLUE, COLOR_RED, COLOR_PURPLE, COLOR_BROWN, COLOR_GREEN, COLOR_CYAN, COLOR_YELLOW)
update_icon()
randpixel_xy()
/obj/item/toy/balloon/color/update_icon() // Only color the balloon, not the string.
..()
if(status == BALLOON_BURST)
worn_overlay = null
cut_overlay()
if(worn_overlay)
add_overlay(overlay_image(icon, "[initial(icon_state)]_[worn_overlay]", flags=RESET_COLOR))
#undef BALLOON_NORMAL
#undef BALLOON_BLOW
#undef BALLOON_BURST
/*
* Fake telebeacon
@@ -83,7 +83,7 @@
/obj/item/bikehorn,
/obj/item/beach_ball,
/obj/item/beach_ball/holoball,
/obj/item/toy/balloon,
/obj/item/toy/waterballoon,
/obj/item/toy/blink,
/obj/item/toy/crossbow,
/obj/item/gun/projectile/revolver/capgun,
@@ -171,7 +171,7 @@
/obj/item/lipstick/random,
/obj/item/clothing/shoes/carp,
/obj/item/bikehorn,
/obj/item/toy/balloon,
/obj/item/toy/waterballoon,
/obj/item/toy/blink,
/obj/item/gun/projectile/revolver/capgun,
/obj/item/toy/prize/deathripley,
@@ -204,7 +204,7 @@
/obj/item/stack/material/animalhide/monkey,
/obj/item/stack/material/animalhide/xeno,
/obj/item/xmasgift/medium,
/obj/item/toy/syndicateballoon,
/obj/item/toy/balloon/syndicate,
/obj/item/toy/xmastree,
/obj/item/bluespace_crystal,
/obj/item/gun/energy/mousegun,
@@ -215,7 +215,7 @@
/obj/item/ore/coal,
/obj/item/stamp/clown,
/obj/item/organ/internal/heart/skrell,
/obj/item/latexballon)
/obj/item/toy/balloon/color)
var/atom/movable/I = new gift_type(get_turf(user))
user.remove_from_mob(src)
@@ -80,9 +80,10 @@
if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
var/obj/item/device/analyzer/A = W
A.analyze_gases(src, user)
else if (istype(W,/obj/item/latexballon))
var/obj/item/latexballon/LB = W
LB.blow(src)
if (istype(W, /obj/item/toy/balloon))
var/obj/item/toy/balloon/B = W
B.blow(src)
src.add_fingerprint(user)
if(istype(W, /obj/item/device/assembly_holder))
+23 -4
View File
@@ -342,6 +342,27 @@
/obj/item/toy/plushie/bearfire
)
/obj/random/balloon
name = "random balloon"
desc = "This is a random balloon."
icon = 'icons/obj/toy.dmi'
icon_state = "balloon"
spawnlist = list(
/obj/item/toy/balloon/color = 7,
/obj/item/toy/balloon/latex = 1,
/obj/item/toy/balloon/latex/nitrile = 1,
/obj/item/toy/balloon/syndicate = 2,
/obj/item/toy/balloon/nanotrasen = 2,
/obj/item/toy/balloon/fellowship = 1,
/obj/item/toy/balloon/fellowshiphead = 1,
/obj/item/toy/balloon/contender = 1,
/obj/item/toy/balloon/contenderhead = 1,
/obj/item/toy/balloon/bat = 1,
/obj/item/toy/balloon/ghost = 1,
/obj/item/toy/balloon/xmastree = 1,
/obj/item/toy/balloon/candycane = 1
)
/obj/random/smalltank
name = "random small tank"
@@ -1180,8 +1201,7 @@
/obj/random/action_figure = 11,
/obj/random/plushie = 44,
/obj/item/toy/cultsword = 5,
/obj/item/toy/syndicateballoon = 5,
/obj/item/toy/nanotrasenballoon = 5,
/obj/random/balloon = 22,
/obj/item/toy/katana = 11,
/obj/item/toy/bosunwhistle = 5,
/obj/item/storage/belt/champion = 11,
@@ -1218,8 +1238,7 @@
/obj/item/toy/crossbow = 11,
/obj/random/action_figure = 11,
/obj/item/toy/cultsword = 7,
/obj/item/toy/syndicateballoon = 10,
/obj/item/toy/nanotrasenballoon = 5,
/obj/random/balloon = 22,
/obj/item/toy/katana = 11,
/obj/random/plushie = 55,
/obj/item/storage/belt/champion = 11,