Merge pull request #11198 from Fox-McCloud/Ohhhhhhhhhhhhhh-sssssshiiittttt-antttttssssss

OHHHH SHITTTT ANTTTSSS
This commit is contained in:
variableundefined
2019-04-02 18:26:26 +08:00
committed by GitHub
11 changed files with 101 additions and 62 deletions

View File

@@ -11,6 +11,7 @@
possible_transfer_amounts = list(5,10,15,20,25,30,50)
volume = 50
burn_state = FIRE_PROOF
antable = FALSE
/obj/item/reagent_containers/food/drinks/New()
..()

View File

@@ -13,10 +13,42 @@
var/transfer_efficiency = 1.0
var/instant_application = 0 //if we want to bypass the forcedfeed delay
var/taste = TRUE//whether you can taste eating from this
var/antable = TRUE // Will ants come near it?
var/ant_location = null
var/ant_timer = null
burn_state = FLAMMABLE
container_type = INJECTABLE
/obj/item/reagent_containers/food/New()
..()
/obj/item/reagent_containers/food/Initialize(mapload)
. = ..()
pixel_x = rand(-5, 5) //Randomizes postion
pixel_y = rand(-5, 5)
if(antable)
ant_location = get_turf(src)
ant_timer = addtimer(CALLBACK(src, .proc/check_for_ants), 3000, TIMER_STOPPABLE)
/obj/item/reagent_containers/food/Destroy()
ant_location = null
if(ant_timer)
deltimer(ant_timer)
return ..()
/obj/item/reagent_containers/food/proc/check_for_ants()
if(!antable)
return
var/turf/T = get_turf(src)
if(isturf(loc) && !locate(/obj/structure/table) in T)
if(ant_location == T)
if(prob(15))
if(!locate(/obj/effect/decal/ants) in T)
new /obj/effect/decal/ants(T)
antable = FALSE
desc += " It appears to be infested with ants. Yuck!"
reagents.add_reagent("ants", 1) // Don't eat things with ants in i you weirdo.
if(ant_timer)
deltimer(ant_timer)
else
ant_location = T
if(ant_timer)
deltimer(ant_timer)
ant_timer = addtimer(CALLBACK(src, .proc/check_for_ants), 3000, TIMER_STOPPABLE)

View File

@@ -1049,6 +1049,11 @@
update_flags |= M.adjustToxLoss(1, FALSE)
return ..() | update_flags
/datum/reagent/pestkiller/reaction_obj(obj/O, volume)
if(istype(O, /obj/effect/decal/ants))
O.visible_message("<span class='warning'>The ants die.</span>")
qdel(O)
/datum/reagent/pestkiller/reaction_mob(mob/living/M, method=TOUCH, volume)
if(iscarbon(M))
var/mob/living/carbon/C = M

View File

@@ -113,7 +113,7 @@
to_chat(user, "<span class='warning'>You cannot fill [target] while it is sealed.</span>")
return
else if(istype(target, /obj/effect/decal/cleanable)) //stops splashing while scooping up fluids
else if(istype(target, /obj/effect/decal)) //stops splashing while scooping up fluids
return
else if(reagents.total_volume)

View File

@@ -11,6 +11,7 @@
volume = 100
consume_sound = null
taste = FALSE
antable = FALSE
/obj/item/reagent_containers/food/pill/New()
..()