From 4ba73baaea9ec6ccbd1855500cc355ee42f913a4 Mon Sep 17 00:00:00 2001 From: yoyobatty Date: Sat, 4 Apr 2020 20:21:34 -0400 Subject: [PATCH 1/2] progress --- code/__DEFINES/~hippie_defines/forge.dm | 5 +++ .../machinery/reagent_material_manipulator.dm | 40 ++++++++++++----- .../code/game/objects/items/forged_weapons.dm | 45 +++++++++---------- .../items/stacks/sheets/sheet_types.dm | 4 +- .../items/stacks/tiles/tile_mineral.dm | 1 + .../turfs/simulated/floor/mineral_floor.dm | 36 +++++++++------ .../reagents/chemistry/reagents/density.dm | 7 ++- 7 files changed, 85 insertions(+), 53 deletions(-) diff --git a/code/__DEFINES/~hippie_defines/forge.dm b/code/__DEFINES/~hippie_defines/forge.dm index d8dd5c844e2..03a7e2880ff 100644 --- a/code/__DEFINES/~hippie_defines/forge.dm +++ b/code/__DEFINES/~hippie_defines/forge.dm @@ -31,6 +31,7 @@ #define SPECIAL_TRAIT_ACID /datum/special_trait/acid #define SPECIAL_TRAIT_FLUIDIC /datum/special_trait/fluidic #define SPECIAL_TRAIT_EXPLOSIVE /datum/special_trait/explosive +#define SPECIAL_TRAIT_SLIPPERY /datum/special_trait/slippery //SPECIAL IDENTIFIERS - saving me some istype checks #define FORGED_MELEE_SINGLEHANDED "singlehanded" @@ -356,3 +357,7 @@ source.reagent_type.reaction_turf(A, type, amount) else if(isobj(A)) source.reagent_type.reaction_obj(A, type, amount) + +/datum/special_trait/slippery + name = "Slippery" + desc = "Honk honk." diff --git a/hippiestation/code/game/machinery/reagent_material_manipulator.dm b/hippiestation/code/game/machinery/reagent_material_manipulator.dm index accc67d856f..b0982dba2f0 100644 --- a/hippiestation/code/game/machinery/reagent_material_manipulator.dm +++ b/hippiestation/code/game/machinery/reagent_material_manipulator.dm @@ -58,6 +58,9 @@ R = I analyse_only = TRUE + else if(istype(I, /obj/item/stack/tile/mineral/reagent)) + R = I + else if(istype(I, /obj/item/forged)) R = I @@ -196,20 +199,33 @@ return FALSE R = F.BB - if(!R) - return FALSE + //else if(istype(loaded, /obj/item/stack/tile/mineral/reagent)) + // R = loaded + + var/obj/item/stack/tile/mineral/reagent/M + if(istype(loaded, /obj/item/stack/tile/mineral/reagent)) + M = loaded for(var/I in synthesis.special_traits) var/datum/special_trait/D = new I if(D.name == params["name"]) - if(locate(D) in R.special_traits) - to_chat(usr, "[R] already has that trait!") - return FALSE - else - R.special_traits += D//doesn't work with lazyadd due to type mismatch (it checks for an explicitly initialized list) - R.speed += SPECIAL_TRAIT_ADD_SPEED_DEBUFF - D.on_apply(R, R.identifier) - reagents.remove_any(SPECIAL_TRAIT_ADD_COST) - to_chat(usr, "You add the trait [D] to [R]") - return TRUE + if(R) + if(locate(D) in R.special_traits) + to_chat(usr, "[R] already has that trait!") + return FALSE + else + R.special_traits += D//doesn't work with lazyadd due to type mismatch (it checks for an explicitly initialized list) + R.speed += SPECIAL_TRAIT_ADD_SPEED_DEBUFF + D.on_apply(R, R.identifier) + reagents.remove_any(SPECIAL_TRAIT_ADD_COST) + to_chat(usr, "You add the trait [D] to [R]") + return TRUE + if(M) + if(locate(D) in M.special_traits) + to_chat(usr, "[M] already has that trait!") + return FALSE + else + M.reagent_type.special_traits += D + to_chat(usr, "You add the trait [D] to [M]") + return TRUE return FALSE diff --git a/hippiestation/code/game/objects/items/forged_weapons.dm b/hippiestation/code/game/objects/items/forged_weapons.dm index 098324cb1a5..cdc1f6a1027 100644 --- a/hippiestation/code/game/objects/items/forged_weapons.dm +++ b/hippiestation/code/game/objects/items/forged_weapons.dm @@ -23,7 +23,6 @@ if(fire) open_flame() - /obj/item/forged/proc/assign_properties() if(reagent_type && weapon_type) special_traits = list() @@ -39,21 +38,21 @@ armour_penetration += force * 0.2 /obj/item/forged/afterattack(atom/target, mob/user, proximity_flag, click_parameters) - user.changeNext_move(speed) - if(iscarbon(target) && reagent_type && proximity_flag) - var/mob/living/carbon/C = target - var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected)) - var/armour_block = C.getarmor(affecting, "melee") * 0.01 - if(!armour_block) - armour_block = 1 - C.reagents.add_reagent(reagent_type.type, max(0, (0.2 * stabby) * max(1, armour_block - armour_penetration))) - if(stabby < 1 && stabby > 0) - reagent_type.reaction_mob(C, TOUCH, max(0, 1 / stabby)) - if(proximity_flag && reagent_type) + if(reagent_type && proximity_flag) + if(iscarbon(target)) + var/mob/living/carbon/C = target + var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected)) + var/armour_block = C.getarmor(affecting, "melee") * 0.01 + if(!armour_block) + armour_block = 1 + C.reagents.add_reagent(reagent_type.type, max(0, (0.2 * stabby) * max(1, armour_block - armour_penetration))) + if(stabby < 1 && stabby > 0) + reagent_type.reaction_mob(C, TOUCH, max(0, 1 / stabby)) for(var/I in special_traits) var/datum/special_trait/A = I if(prob(A.effectiveness)) A.on_hit(target, user, src, FORGED_MELEE_SINGLEHANDED) + user.changeNext_move(speed) ..() /obj/item/forged/melee/dagger @@ -144,21 +143,21 @@ /obj/item/twohanded/forged/afterattack(atom/target, mob/user, proximity_flag, click_parameters) - user.changeNext_move(speed) - if(iscarbon(target) && reagent_type && proximity_flag) - var/mob/living/carbon/C = target - var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected)) - var/armour_block = C.getarmor(affecting, "melee") * 0.01 - if(!armour_block) - armour_block = 1 - C.reagents.add_reagent(reagent_type.type, max(0, (0.2 * stabby) * max(1, armour_block - armour_penetration))) - if(stabby < 1 && stabby > 0) - reagent_type.reaction_mob(C, TOUCH, max(0, 1 / stabby)) - if(proximity_flag && reagent_type) + if(reagent_type && proximity_flag) + if(iscarbon(target)) + var/mob/living/carbon/C = target + var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected)) + var/armour_block = C.getarmor(affecting, "melee") * 0.01 + if(!armour_block) + armour_block = 1 + C.reagents.add_reagent(reagent_type.type, max(0, (0.2 * stabby) * max(1, armour_block - armour_penetration))) + if(stabby < 1 && stabby > 0) + reagent_type.reaction_mob(C, TOUCH, max(0, 1 / stabby)) for(var/I in special_traits) var/datum/special_trait/A = I if(prob(A.effectiveness)) A.on_hit(target, user, src, FORGED_MELEE_TWOHANDED) + user.changeNext_move(speed) ..() /obj/item/twohanded/forged/greatsword diff --git a/hippiestation/code/game/objects/items/stacks/sheets/sheet_types.dm b/hippiestation/code/game/objects/items/stacks/sheets/sheet_types.dm index 5c19c955bd0..139bf670bd5 100644 --- a/hippiestation/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/hippiestation/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -17,9 +17,8 @@ GLOBAL_LIST_INIT(reagent_recipes, list ( \ )) /obj/item/stack/sheet/mineral/reagent/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.reagent_recipes . = ..() - + recipes = GLOB.reagent_recipes /obj/item/stack/sheet/mineral/reagent/change_stack(mob/user,amount) var/obj/item/stack/sheet/mineral/reagent/F = new(user, amount, FALSE) @@ -131,6 +130,7 @@ GLOBAL_LIST_INIT(reagent_recipes, list ( \ F.singular_name = "[reagent_type] floor tile" F.desc = "floor tiles made of [reagent_type]" F.add_atom_colour(reagent_type.color, FIXED_COLOUR_PRIORITY) + F.special_traits = reagent_type.special_traits break else qdel(RR) diff --git a/hippiestation/code/game/objects/items/stacks/tiles/tile_mineral.dm b/hippiestation/code/game/objects/items/stacks/tiles/tile_mineral.dm index 91a8089ca46..d43f083a340 100644 --- a/hippiestation/code/game/objects/items/stacks/tiles/tile_mineral.dm +++ b/hippiestation/code/game/objects/items/stacks/tiles/tile_mineral.dm @@ -7,6 +7,7 @@ mineralType = "reagent" materials = list(MAT_REAGENT=500) var/datum/reagent/reagent_type + var/list/special_traits /obj/item/stack/tile/mineral/reagent/change_stack(mob/user,amount) var/obj/item/stack/tile/mineral/reagent/F = new(user, amount, FALSE) diff --git a/hippiestation/code/game/turfs/simulated/floor/mineral_floor.dm b/hippiestation/code/game/turfs/simulated/floor/mineral_floor.dm index d50fa531cb1..dca28f50b58 100644 --- a/hippiestation/code/game/turfs/simulated/floor/mineral_floor.dm +++ b/hippiestation/code/game/turfs/simulated/floor/mineral_floor.dm @@ -5,23 +5,31 @@ icons = list("titanium_white","titanium_dam1") var/datum/reagent/reagent_type var/obj/effect/particle_effect/fakeholder + var/boil_temp = 3000 -/turf/open/floor/mineral/reagent/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature && !fakeholder) - fakeholder = new(get_turf(src)) - fakeholder.create_reagents(50) - fakeholder.reagents.add_reagent(reagent_type.type, 50, reagtemp = exposed_temperature) - fakeholder.reagents.handle_reactions() - QDEL_IN(fakeholder, 150) +/turf/open/floor/mineral/reagent/Initialize() + . = ..() + addtimer(CALLBACK(src, .proc/Check_Traits), 1) - else if(exposed_temperature && fakeholder && !QDELETED(fakeholder)) - fakeholder.reagents.chem_temp = exposed_temperature - fakeholder.reagents.handle_reactions() +/turf/open/floor/mineral/reagent/proc/Check_Traits() + if(LAZYFIND(reagent_type.special_traits, SPECIAL_TRAIT_SLIPPERY)) + MakeSlippery(TURF_WET_WATER, INFINITY, 0, INFINITY, TRUE) - if(exposed_temperature > 3000) - for(var/mob/M in viewers(3, src)) - to_chat(M, ("[icon2html(src, viewers(src))] The [src] boils away in the extreme heat!")) - vapourise() +/turf/open/floor/mineral/reagent/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + if(exposed_temperature) + if(!QDELETED(fakeholder)) + fakeholder.reagents.chem_temp = exposed_temperature + fakeholder.reagents.handle_reactions() + else + fakeholder = new(get_turf(src)) + fakeholder.create_reagents(50) + fakeholder.reagents.add_reagent(reagent_type.type, 50, reagtemp = exposed_temperature) + fakeholder.reagents.handle_reactions() + QDEL_IN(fakeholder, 150) + if(exposed_temperature > boil_temp) + for(var/mob/M in viewers(3, src)) + to_chat(M, ("[icon2html(src, viewers(src))] The [src] boils away in the extreme heat!")) + vapourise() ..() /turf/open/floor/mineral/reagent/proc/vapourise() diff --git a/hippiestation/code/modules/reagents/chemistry/reagents/density.dm b/hippiestation/code/modules/reagents/chemistry/reagents/density.dm index 9c6fde80e07..25079f98a5d 100644 --- a/hippiestation/code/modules/reagents/chemistry/reagents/density.dm +++ b/hippiestation/code/modules/reagents/chemistry/reagents/density.dm @@ -83,7 +83,7 @@ //BOUNCY /datum/reagent/lube - special_traits = list(SPECIAL_TRAIT_BOUNCY, SPECIAL_TRAIT_FLUIDIC) + special_traits = list(SPECIAL_TRAIT_BOUNCY, SPECIAL_TRAIT_FLUIDIC, SPECIAL_TRAIT_SLIPPERY) /datum/reagent/plastic_polymers special_traits = list(SPECIAL_TRAIT_BOUNCY, SPECIAL_TRAIT_REFLECTIVE) @@ -142,7 +142,7 @@ special_traits = list(SPECIAL_TRAIT_MAGNETIC) /datum/reagent/water - special_traits = list(SPECIAL_TRAIT_REFLECTIVE) + special_traits = list(SPECIAL_TRAIT_REFLECTIVE, SPECIAL_TRAIT_SLIPPERY) /datum/reagent/arclumin special_traits = list(SPECIAL_TRAIT_UNSTABLE) @@ -155,3 +155,6 @@ /datum/reagent/colorful_reagent special_traits = list(SPECIAL_TRAIT_FLUIDIC) + +/datum/reagent/consumable/banana + special_traits = list(SPECIAL_TRAIT_REFLECTIVE, SPECIAL_TRAIT_SLIPPERY) From 66c520e2744a2721f11d47207ee960f022b5b707 Mon Sep 17 00:00:00 2001 From: yoyobatty Date: Sat, 4 Apr 2020 22:04:42 -0400 Subject: [PATCH 2/2] ah fine --- .../machinery/reagent_material_manipulator.dm | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/hippiestation/code/game/machinery/reagent_material_manipulator.dm b/hippiestation/code/game/machinery/reagent_material_manipulator.dm index b0982dba2f0..83c710a22c1 100644 --- a/hippiestation/code/game/machinery/reagent_material_manipulator.dm +++ b/hippiestation/code/game/machinery/reagent_material_manipulator.dm @@ -58,9 +58,6 @@ R = I analyse_only = TRUE - else if(istype(I, /obj/item/stack/tile/mineral/reagent)) - R = I - else if(istype(I, /obj/item/forged)) R = I @@ -198,13 +195,7 @@ if(!F.BB)//this has no bullet return FALSE R = F.BB - - //else if(istype(loaded, /obj/item/stack/tile/mineral/reagent)) - // R = loaded - - var/obj/item/stack/tile/mineral/reagent/M - if(istype(loaded, /obj/item/stack/tile/mineral/reagent)) - M = loaded + for(var/I in synthesis.special_traits) var/datum/special_trait/D = new I if(D.name == params["name"]) @@ -219,13 +210,4 @@ reagents.remove_any(SPECIAL_TRAIT_ADD_COST) to_chat(usr, "You add the trait [D] to [R]") return TRUE - if(M) - if(locate(D) in M.special_traits) - to_chat(usr, "[M] already has that trait!") - return FALSE - else - M.reagent_type.special_traits += D - to_chat(usr, "You add the trait [D] to [M]") - return TRUE - return FALSE