From 5bfa01d79e5f07520ed09e2764493a19509275ef Mon Sep 17 00:00:00 2001 From: Alberyk Date: Sun, 27 Nov 2016 16:00:35 -0200 Subject: [PATCH] Syndicate borg fix mk II and bees. (#23) Reverting back to old code, but, now fixing all the issue, and fuck ghost trap for this for now. Also, re-adding our unique murderous bees. --- baystation12.dme | 3 + code/game/gamemodes/antagspawner.dm | 49 +++- code/game/objects/items/bees_items.dm | 122 +++++++++ code/game/objects/items/weapons/trays.dm | 2 +- code/modules/clothing/suits/utility.dm | 4 +- code/modules/hydroponics/trays/tray_apiary.dm | 240 ++++++++++++++++++ .../projectiles/guns/energy/nuclear.dm | 4 +- 7 files changed, 408 insertions(+), 16 deletions(-) create mode 100644 code/game/objects/items/bees_items.dm create mode 100644 code/modules/hydroponics/trays/tray_apiary.dm diff --git a/baystation12.dme b/baystation12.dme index eebc61c47d4..5fbeea19606 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -601,6 +601,7 @@ #include "code\game\objects\effects\spawners\bombspawner.dm" #include "code\game\objects\effects\spawners\gibspawner.dm" #include "code\game\objects\items\apc_frame.dm" +#include "code\game\objects\items\bees_items.dm" #include "code\game\objects\items\blueprints.dm" #include "code\game\objects\items\bodybag.dm" #include "code\game\objects\items\contraband.dm" @@ -1209,6 +1210,7 @@ #include "code\modules\hydroponics\spreading\spreading_growth.dm" #include "code\modules\hydroponics\spreading\spreading_response.dm" #include "code\modules\hydroponics\trays\tray.dm" +#include "code\modules\hydroponics\trays\tray_apiary.dm" #include "code\modules\hydroponics\trays\tray_process.dm" #include "code\modules\hydroponics\trays\tray_reagents.dm" #include "code\modules\hydroponics\trays\tray_soil.dm" @@ -1467,6 +1469,7 @@ #include "code\modules\mob\living\silicon\robot\drone\drone_items.dm" #include "code\modules\mob\living\silicon\robot\drone\drone_manufacturer.dm" #include "code\modules\mob\living\silicon\robot\drone\drone_say.dm" +#include "code\modules\mob\living\simple_animal\bees.dm" #include "code\modules\mob\living\simple_animal\corpse.dm" #include "code\modules\mob\living\simple_animal\parrot.dm" #include "code\modules\mob\living\simple_animal\shade.dm" diff --git a/code/game/gamemodes/antagspawner.dm b/code/game/gamemodes/antagspawner.dm index e2e2d75dcf7..4deb202d60b 100644 --- a/code/game/gamemodes/antagspawner.dm +++ b/code/game/gamemodes/antagspawner.dm @@ -26,22 +26,44 @@ var/searching = 0 var/askDelay = 10 * 60 * 1 -/obj/item/weapon/antag_spawner/borg_tele/attack_self(mob/user as mob) - if(searching == 0) - //Start the process of searching for a new user. - user << "You carefully locate the manual activation switch and start the positronic brain's boot process." - src.searching = 1 - var/datum/ghosttrap/G = get_ghost_trap("syndicate cyborg") - G.request_player(brainmob, "Someone is requesting a syndicate cyborg.", 60 SECONDS) - spawn_antag(G, get_turf(src)) - spawn(600) reset_search() +/obj/item/weapon/antag_spawner/borg_tele/attack_self(mob/user) + user << "The syndicate robot teleporter is attempting to locate an available cyborg." + searching = 1 + for(var/mob/dead/observer/O in player_list) + if(!O.MayRespawn()) + continue + if(jobban_isbanned(O, "Syndicate") && jobban_isbanned(O, "Mercenary") && jobban_isbanned(O, "Cyborg")) + continue + if(O.client && O.client.prefs && (MODE_MERCENARY in O.client.prefs.be_special_role)) + question(O.client) + + spawn(600) + searching = 0 + if(!used) + user << "Unable to connect to the Syndicate Command. Perhaps you could try again later?" -obj/item/weapon/antag_spawner/borg_tele/spawn_antag(client/G, turf/T) + +/obj/item/weapon/antag_spawner/borg_tele/proc/question(var/client/C) + spawn(0) + if(!C) + return + var/response = alert(C, "Someone is requesting a syndicate cyborg Would you like to play as one?", + "Syndicate robot request","Yes", "No", "Never for this round") + if(response == "Yes") + response = alert(C, "Are you sure you want to play as a syndicate cyborg?", "Syndicate cyborg request", "Yes", "No") + if(!C || used || !searching) + return + if(response == "Yes") + spawn_antag(C, get_turf(src)) + else if (response == "Never for this round") + C.prefs.be_special_role ^= MODE_MERCENARY + +obj/item/weapon/antag_spawner/borg_tele/spawn_antag(client/C, turf/T) var/datum/effect/effect/system/spark_spread/S = new /datum/effect/effect/system/spark_spread S.set_up(4, 1, src) S.start() var/mob/living/silicon/robot/H = new /mob/living/silicon/robot/syndicate(T) - H.key = G.key + H.key = C.key var/newname = sanitizeSafe(input(H,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN) if (newname != "") H.real_name = newname @@ -49,6 +71,11 @@ obj/item/weapon/antag_spawner/borg_tele/spawn_antag(client/G, turf/T) H.mind.special_role = "Mercenary" H << "You are a syndicate cyborg, bound to help and follow the orders of the mercenaries that are deploying you. Remember to speak to the other mercenaries to know more about their plans, you are also able to change your name using the name pick command." + spawn(1) + used = 1 + qdel(src) + H << "You are a syndicate cyborg, bound to help and follow the orders of the mercenaries that are deploying you. Remember to speak to the other mercenaries to know more about their plans, you are also able to change your name using the name pick command." + spawn(1) used = 1 qdel(src) diff --git a/code/game/objects/items/bees_items.dm b/code/game/objects/items/bees_items.dm new file mode 100644 index 00000000000..05f9231f8a3 --- /dev/null +++ b/code/game/objects/items/bees_items.dm @@ -0,0 +1,122 @@ + +/obj/item/queen_bee + name = "queen bee packet" + desc = "Place her into an apiary so she can get busy." + icon = 'icons/obj/seeds.dmi' + icon_state = "seed-kudzu" + w_class = 1 + +/obj/item/weapon/bee_net + name = "bee net" + desc = "For catching rogue bees." + icon = 'icons/obj/apiary_bees_etc.dmi' + icon_state = "bee_net" + item_state = "bedsheet" + w_class = 3 + var/caught_bees = 0 + +/obj/item/weapon/bee_net/attack_self(mob/user as mob) + var/turf/T = get_step(get_turf(user), user.dir) + for(var/mob/living/simple_animal/bee/B in T) + if(B.feral < 0) + caught_bees += B.strength + qdel(B) + user.visible_message("\blue [user] nets some bees.","\blue You net up some of the becalmed bees.") + else + user.visible_message("\red [user] swings at some bees, they don't seem to like it.","\red You swing at some bees, they don't seem to like it.") + B.feral = 5 + B.target_mob = user + +/obj/item/weapon/bee_net/verb/empty_bees() + set src in usr + set name = "Empty bee net" + set category = "Object" + var/mob/living/carbon/M + if(iscarbon(usr)) + M = usr + + while(caught_bees > 0) + //release a few super massive swarms + while(caught_bees > 5) + var/mob/living/simple_animal/bee/B = new(src.loc) + B.feral = 5 + B.target_mob = M + B.strength = 6 + B.icon_state = "bees_swarm" + caught_bees -= 6 + + //what's left over + var/mob/living/simple_animal/bee/B = new(src.loc) + B.strength = caught_bees + B.icon_state = "bees[B.strength]" + B.feral = 5 + B.target_mob = M + + caught_bees = 0 + +/obj/item/apiary + name = "moveable apiary" + icon = 'icons/obj/apiary_bees_etc.dmi' + icon_state = "apiary_item" + item_state = "giftbag" + w_class = 5 + +/obj/item/beezeez + name = "bottle of BeezEez" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle17" + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +/obj/item/weapon/reagent_containers/food/snacks/honeycomb + name = "honeycomb" + icon_state = "honeycomb" + desc = "Dripping with sugary sweetness." + + New() + ..() + +/obj/item/weapon/reagent_containers/food/snacks/honeycomb/New() + ..() + reagents.add_reagent("honey",10) + reagents.add_reagent("nutriment", 0.5) + reagents.add_reagent("sugar", 2) + bitesize = 2 + +/datum/reagent/honey + name = "Honey" + id = "honey" + description = "A golden yellow syrup, loaded with sugary sweetness." + color = "#FFFF00" + +/obj/item/weapon/book/manual/hydroponics_beekeeping + name = "The Ins and Outs of Apiculture - A Precise Art" + icon_state ="bookHydroponicsBees" + author = "Beekeeper Dave" + title = "The Ins and Outs of Apiculture - A Precise Art" + dat = {" + + + + +

Raising Bees

+ + Bees are loving but fickle creatures. Don't mess with their hive and stay away from any clusters of them, and you'll avoid their ire. + Sometimes, you'll need to dig around in there for those delicious sweeties though - in that case make sure you wear sealed protection gear + and carry an extinguisher or smoker with you - any bees chasing you, once calmed down, can thusly be netted and returned safely to the hive. + BeezEez is a cure-all panacea for them, but use it too much and the hive may grow to apocalyptic proportions. Other than that, bees are excellent pets + for all the family and are excellent caretakers of one's garden: having a hive or two around will aid in the longevity and growth rate of plants, + and aid them in fighting off poisons and disease. + + + + "} diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm index 880837452b4..f1298bd72dd 100644 --- a/code/game/objects/items/weapons/trays.dm +++ b/code/game/objects/items/weapons/trays.dm @@ -148,7 +148,7 @@ /obj/item/weapon/tray/var/cooldown = 0 //shield bash cooldown. based on world.time /obj/item/weapon/tray/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (issilicon(M))//safety to stop robots losing their items + if (istype(user,/mob/living/silicon/robot))//safety to stop robots losing their items return if (istype(W, /obj/item/weapon/tray))//safety to prevent tray stacking diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index d20c3268645..8e6c4446ef6 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -54,7 +54,7 @@ desc = "Use in case of bomb." icon_state = "bombsuit" w_class = 5//Too large to fit in a backpack - flags_item = STOPPRESSUREDAMAGE|THICKMATERIAL|BLOCK_GAS_SMOKE_EFFECT + item_flags = STOPPRESSUREDAMAGE|THICKMATERIAL|BLOCK_GAS_SMOKE_EFFECT armor = list(melee = 30, bullet = 20, laser = 25,energy = 30, bomb = 100, bio = 60, rad = 60) flags_inv = HIDEMASK|HIDEEARS|HIDEEYES body_parts_covered = HEAD|FACE|EYES @@ -77,7 +77,7 @@ permeability_coefficient = 0.01 slowdown = 8 armor = list(melee = 55, bullet = 55, laser = 55,energy = 60, bomb = 100, bio = 60, rad = 60) - flags_item = STOPPRESSUREDAMAGE|THICKMATERIAL + item_flags = STOPPRESSUREDAMAGE|THICKMATERIAL flags_inv = HIDEJUMPSUIT|HIDETAIL heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS cold_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS diff --git a/code/modules/hydroponics/trays/tray_apiary.dm b/code/modules/hydroponics/trays/tray_apiary.dm new file mode 100644 index 00000000000..80280fecde1 --- /dev/null +++ b/code/modules/hydroponics/trays/tray_apiary.dm @@ -0,0 +1,240 @@ +//http://www.youtube.com/watch?v=-1GadTfGFvU +//i could have done these as just an ordinary plant, but fuck it - there would have been too much snowflake code + +/obj/machinery/apiary + name = "apiary tray" + icon = 'icons/obj/hydroponics_machines.dmi' + icon_state = "hydrotray3" + density = 1 + anchored = 1 + var/nutrilevel = 0 + var/yieldmod = 1 + var/mut = 1 + var/toxic = 0 + var/dead = 0 + var/health = -1 + var/maxhealth = 100 + var/lastcycle = 0 + var/cycledelay = 100 + var/harvestable_honey = 0 + var/beezeez = 0 + var/swarming = 0 + + var/bees_in_hive = 0 + var/list/owned_bee_swarms = list() + var/hydrotray_type = /obj/machinery/portable_atmospherics/hydroponics + +//overwrite this after it's created if the apiary needs a custom machinery sprite +/obj/machinery/apiary/New() + ..() + overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary") + +/obj/machinery/apiary/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables. + if(istype(Proj ,/obj/item/projectile/energy/floramut)) + mut++ + else if(istype(Proj ,/obj/item/projectile/energy/florayield)) + if(!yieldmod) + yieldmod += 1 + //world << "Yield increased by 1, from 0, to a total of [myseed.yield]" + else if (prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2... + yieldmod += 1 + //world << "Yield increased by 1, to a total of [myseed.yield]" + else + ..() + return + +/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob) + if(istype(O, /obj/item/queen_bee)) + if(health > 0) + user << "\red There is already a queen in there." + else + health = 10 + nutrilevel += 10 + user.drop_item() + qdel(O) + user << "\blue You carefully insert the queen into [src], she gets busy making a hive." + bees_in_hive = 0 + else if(istype(O, /obj/item/beezeez)) + beezeez += 100 + nutrilevel += 10 + user.drop_item() + if(health > 0) + user << "\blue You insert [O] into [src]. A relaxed humming appears to pick up." + else + user << "\blue You insert [O] into [src]. Now it just needs some bees." + qdel(O) + else if(istype(O, /obj/item/weapon/material/minihoe)) + if(health > 0) + user << "\red You begin to dislodge the apiary from the tray, the bees don't like that." + angry_swarm(user) + else + user << "\blue You begin to dislodge the dead apiary from the tray." + if(do_after(user, 50)) + new hydrotray_type(src.loc) + new /obj/item/apiary(src.loc) + user << "\red You dislodge the apiary from the tray." + qdel(src) + else if(istype(O, /obj/item/weapon/bee_net)) + var/obj/item/weapon/bee_net/N = O + if(N.caught_bees > 0) + user << "\blue You empty the bees into the apiary." + bees_in_hive += N.caught_bees + N.caught_bees = 0 + else + user << "\blue There are no more bees in the net." + else if(istype(O, /obj/item/weapon/reagent_containers/glass)) + var/obj/item/weapon/reagent_containers/glass/G = O + if(harvestable_honey > 0) + if(health > 0) + user << "\red You begin to harvest the honey. The bees don't seem to like it." + angry_swarm(user) + else + user << "\blue You begin to harvest the honey." + if(do_after(user,50)) + G.reagents.add_reagent("honey",harvestable_honey) + harvestable_honey = 0 + user << "\blue You successfully harvest the honey." + else + user << "\blue There is no honey left to harvest." + else + angry_swarm(user) + ..() + +/obj/machinery/apiary/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + if(air_group || (height==0)) return 1 + + if(istype(mover) && mover.checkpass(PASSTABLE)) + return 1 + else + return 0 + +/obj/machinery/apiary/process() + + if(swarming > 0) + swarming -= 1 + if(swarming <= 0) + for(var/mob/living/simple_animal/bee/B in src.loc) + bees_in_hive += B.strength + qdel(B) + else if(bees_in_hive < 10) + for(var/mob/living/simple_animal/bee/B in src.loc) + bees_in_hive += B.strength + qdel(B) + + if(world.time > (lastcycle + cycledelay)) + lastcycle = world.time + if(health < 0) + return + + //magical bee formula + if(beezeez > 0) + beezeez -= 1 + + nutrilevel += 2 + health += 1 + toxic = max(0, toxic - 1) + + //handle nutrients + nutrilevel -= bees_in_hive / 10 + owned_bee_swarms.len / 5 + if(nutrilevel > 0) + bees_in_hive += 1 * yieldmod + if(health < maxhealth) + health++ + else + //nutrilevel is less than 1, so we're effectively subtracting here + health += max(nutrilevel - 1, round(-health / 2)) + bees_in_hive += max(nutrilevel - 1, round(-bees_in_hive / 2)) + if(owned_bee_swarms.len) + var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms) + B.target_turf = get_turf(src) + + //clear out some toxins + if(toxic > 0) + toxic -= 1 + health -= 1 + + if(health <= 0) + return + + //make a bit of honey + if(harvestable_honey < 50) + harvestable_honey += 0.5 + + //make some new bees + if(bees_in_hive >= 10 && prob(bees_in_hive * 10)) + var/mob/living/simple_animal/bee/B = new(get_turf(src), src) + owned_bee_swarms.Add(B) + B.mut = mut + B.toxic = toxic + bees_in_hive -= 1 + + //find some plants, harvest + for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src)) + if(H.seed && !H.dead && prob(owned_bee_swarms.len * 10)) + src.nutrilevel++ + H.nutrilevel++ + if(mut < H.mutation_mod - 1) + mut = H.mutation_mod - 1 + else if(mut > H.mutation_mod - 1) + H.mutation_mod = mut + + //flowers give us pollen (nutrients) +/* - All plants should be giving nutrients to the hive. + if(H.myseed.type == /obj/item/seeds/harebell || H.myseed.type == /obj/item/seeds/sunflowerseed) + src.nutrilevel++ + H.nutrilevel++ +*/ + //have a few beneficial effects on nearby plants + if(prob(10)) + H.lastcycle -= 5 + if(prob(10)) + H.seed.set_trait(TRAIT_ENDURANCE,max(H.seed.get_trait(TRAIT_ENDURANCE)*1.5,H.seed.get_trait(TRAIT_ENDURANCE)+1)) + if(H.toxins && prob(10)) + H.toxins = min(0, H.toxins - 1) + toxic++ + +/obj/machinery/apiary/proc/die() + if(owned_bee_swarms.len) + var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms) + B.target_turf = get_turf(src) + B.strength -= 1 + if(B.strength <= 0) + qdel(B) + else if(B.strength <= 5) + B.icon_state = "bees[B.strength]" + bees_in_hive = 0 + health = 0 + +/obj/machinery/apiary/proc/angry_swarm(var/mob/M) + for(var/mob/living/simple_animal/bee/B in owned_bee_swarms) + B.feral = 25 + B.target_mob = M + + swarming = 25 + + while(bees_in_hive > 0) + var/spawn_strength = bees_in_hive + if(bees_in_hive >= 5) + spawn_strength = 6 + + var/mob/living/simple_animal/bee/B = new(get_turf(src), src) + B.target_mob = M + B.strength = spawn_strength + B.feral = 25 + B.mut = mut + B.toxic = toxic + bees_in_hive -= spawn_strength + +/obj/machinery/apiary/verb/harvest_honeycomb() + set src in oview(1) + set name = "Harvest honeycomb" + set category = "Object" + + while(health > 15) + health -= 15 + var/obj/item/weapon/reagent_containers/food/snacks/honeycomb/H = new(src.loc) + if(toxic > 0) + H.reagents.add_reagent("toxin", toxic) + + usr << "\blue You harvest the honeycomb from the hive. There is a wild buzzing!" + angry_swarm(usr) diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm index c30119c0e18..8bc6ce8cf4c 100644 --- a/code/modules/projectiles/guns/energy/nuclear.dm +++ b/code/modules/projectiles/guns/energy/nuclear.dm @@ -98,11 +98,11 @@ switch(current_mode.name) if("stun") overlays += "nucgun-stun" if("lethal") overlays += "nucgun-kill" - +/* /obj/item/weapon/gun/energy/gun/nuclear/emp_act(severity) ..() reliability -= round(15/severity) - +*/ /obj/item/weapon/gun/energy/gun/nuclear/update_icon() overlays.Cut() update_charge()