Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge improvements [WIP] #12715

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions code/__DEFINES/~hippie_defines/forge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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."
26 changes: 12 additions & 14 deletions hippiestation/code/game/machinery/reagent_material_manipulator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,19 @@
if(!F.BB)//this has no bullet
return FALSE
R = F.BB

if(!R)
return FALSE

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, "<span class='warning'>[R] already has that trait!</span>")
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, "<span class='notice'>You add the trait [D] to [R]</span>")
return TRUE

if(R)
if(locate(D) in R.special_traits)
to_chat(usr, "<span class='warning'>[R] already has that trait!</span>")
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, "<span class='notice'>You add the trait [D] to [R]</span>")
return TRUE
return FALSE
45 changes: 22 additions & 23 deletions hippiestation/code/game/objects/items/forged_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
if(fire)
open_flame()


/obj/item/forged/proc/assign_properties()
if(reagent_type && weapon_type)
special_traits = list()
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
36 changes: 22 additions & 14 deletions hippiestation/code/game/turfs/open/floor/mineral_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, ("<span class='warning'>[icon2html(src, viewers(src))] The [src] boils away in the extreme heat!</span>"))
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, ("<span class='warning'>[icon2html(src, viewers(src))] The [src] boils away in the extreme heat!</span>"))
vapourise()
..()

/turf/open/floor/mineral/reagent/proc/vapourise()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)