-
-
Notifications
You must be signed in to change notification settings - Fork 458
[READY] Adds Preternis! #4656
[READY] Adds Preternis! #4656
Changes from 6 commits
7bd20a9
4c49ed8
3188a60
73bbbc2
281c0e9
dae25bf
dd9e2c9
c231ce1
a8e9d97
d957477
a5dc373
519e13f
0906438
8ab88e3
c54eb03
5e2252b
ba28f66
26f2de3
77a8f7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #define PRETERNIS_LEVEL_FULL 550 | ||
| #define PRETERNIS_LEVEL_WELL_FED 450 | ||
| #define PRETERNIS_LEVEL_FED 350 | ||
| #define PRETERNIS_LEVEL_HUNGRY 250 | ||
| #define PRETERNIS_LEVEL_STARVING 150 | ||
| #define PRETERNIS_LEVEL_NONE 0 | ||
|
|
||
| #define ELECTRICITY_TO_NUTRIMENT_FACTOR 0.12 | ||
|
|
||
| #define PRETERNIS_NV_OFF 2 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming that this is how far you can see with NV on/off, should probably have a comment though |
||
| #define PRETERNIS_NV_ON 8 | ||
|
|
||
| #define BODYPART_ANY -1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /mob/living/carbon/human/CanContractDisease(datum/disease/D) | ||
| var/infectchance = dna.species ? dna.species.yogs_virus_infect_chance : 100 //will this compile? who knows | ||
| if(prob(infectchance)) | ||
| return ..() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /datum/disease/advance/Refresh(new_name) | ||
| . = ..() | ||
| if(affected_mob.dna) | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| var/datum/species/S | ||
| properties["resistance"] += S.virus_resistance_boost | ||
| properties["stealth"] += S.virus_stealth_boost | ||
| properties["stage_rate"] += S.virus_stage_rate_boost | ||
| properties["transmittable"] += S.virus_transmittable_boost | ||
| AssignProperties() //this is a bit inefficent because its called twice but modularization amiright? | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /obj/item/organ/eyes/preternis | ||
| name = "preternis eyes" | ||
| desc = "An experimental upgraded version of eyes that can see in the dark.They are designed to fit preternis" | ||
| see_in_dark = 8 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE | ||
| actions_types = list(/datum/action/item_action/organ_action/use) | ||
| var/night_vision = TRUE | ||
|
|
||
| /obj/item/organ/eyes/preternis/ui_action_click() | ||
| var/datum/species/preternis/S = owner.dna.species | ||
| if(S.charge < PRETERNIS_LEVEL_FED) | ||
| return | ||
| sight_flags = initial(sight_flags) | ||
| switch(lighting_alpha) | ||
| if (LIGHTING_PLANE_ALPHA_VISIBLE) | ||
| lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE | ||
| if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) | ||
| lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE | ||
| if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE) | ||
| lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE | ||
| else | ||
| lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE | ||
| sight_flags &= ~SEE_BLACKNESS | ||
| owner.update_sight() | ||
|
|
||
| /obj/item/organ/eyes/preternis/on_life() | ||
| . = ..() | ||
| if(!ispreternis(owner)) | ||
| qdel(src) //these eyes depend on being inside a preternis | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can't you like, just make them not work rather than making a specieschange mean they lose their eyes permanently?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i tought so too but it gives them new eyes of the other species when they switch so this just affects transplants and its not meant to be in a preternis and this is wasted process cycles otherwise,tell me if its mandatory i change this |
||
| return | ||
| var/datum/species/preternis/S = owner.dna.species | ||
| if(S.charge >= PRETERNIS_LEVEL_FED) | ||
| if(see_in_dark == PRETERNIS_NV_OFF) | ||
| see_in_dark = PRETERNIS_NV_ON | ||
| owner.update_sight() | ||
| else | ||
| if(see_in_dark == PRETERNIS_NV_ON) | ||
| see_in_dark = PRETERNIS_NV_OFF | ||
| owner.update_sight() | ||
| if(lighting_alpha < LIGHTING_PLANE_ALPHA_VISIBLE) | ||
| lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE | ||
| sight_flags &= ~SEE_BLACKNESS | ||
| owner.update_sight() | ||
|
|
||
| /obj/item/organ/lungs/preternis | ||
| name = "preternis lungs" | ||
| desc = "An experimental set of lungs.Due to the cybernetic nature of these lungs,they are less resistant to heat and cold but are more efficent at filtering oxygen." | ||
| icon_state = "lungs-c" | ||
| safe_oxygen_min = 12 | ||
| safe_toxins_max = 10 | ||
| gas_stimulation_min = 0.1 //fucking filters removing my stimulants | ||
|
|
||
| cold_level_1_threshold = 280 | ||
| cold_level_1_damage = 1.5 | ||
| cold_level_2_threshold = 260 | ||
| cold_level_2_damage = 3 | ||
| cold_level_3_threshold = 200 | ||
| cold_level_3_damage = 4.5 | ||
|
|
||
| heat_level_1_threshold = 320 | ||
| heat_level_2_threshold = 400 | ||
| heat_level_3_threshold = 600 //HALP MY LUNGS ARE ON FIRE | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| /mob/living/carbon/AltClickOn(atom/A) | ||
| if(ispreternis(src)) | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| dna.species.spec_AltClickOn(A,src) | ||
| return | ||
| ..() | ||
|
|
||
| /datum/species/preternis/spec_AltClickOn(atom/A,H) | ||
| return species_drain_act(H, A) | ||
|
|
||
| /datum/species/preternis/proc/species_drain_act(mob/living/carbon/human/H, atom/A) | ||
| if(!istype(H) || !A) | ||
| return 0 | ||
|
|
||
| if(!A.can_consume_power_from()) | ||
| return 0 //if it returns text, we want it to continue so we can get the error message later. | ||
|
|
||
| var/siemens_coefficient = 1 | ||
|
|
||
| if(H.reagents.has_reagent("teslium")) | ||
| siemens_coefficient *= 1.5 | ||
|
|
||
| if (charge == PRETERNIS_LEVEL_FULL - 25) | ||
| to_chat(H,"<span class='notice'>CONSUME protocol reports no need for additional power at this time.</span>") | ||
| return 1 | ||
|
|
||
| if(H.gloves) | ||
| if(H.gloves.siemens_coefficient == 0) | ||
| to_chat(H,"<span class='info'>NOTICE: [H.gloves] prevent electrical contact - CONSUME protocol aborted.</span>") | ||
| return 1 | ||
| else | ||
| if(H.gloves.siemens_coefficient < 1) | ||
| to_chat(H,"<span class='info'>NOTICE: [H.gloves] are interfering with electrical contact - advise removal before activating CONSUME protocol.</span>") | ||
| siemens_coefficient *= H.gloves.siemens_coefficient | ||
|
|
||
| H.face_atom(A) | ||
| H.visible_message("<span class='warning'>[H] starts placing their hands on [A]...</span>", "<span class='warning'>You start placing your hands on [A]...</span>") | ||
| if(!do_after(H, 20, target = A)) | ||
| to_chat(H,"<span class='info'>CONSUME protocol aborted.</span>") | ||
| return 1 | ||
|
|
||
| to_chat(H,"<span class='info'>Extracutaneous implants detect viable power source. Initiating CONSUME protocol.</span>") | ||
|
|
||
| var/done = 0 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| var/drain = 150 * siemens_coefficient | ||
|
|
||
| var/cycle = 0 | ||
| var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread() | ||
| spark_system.attach(A) | ||
| spark_system.set_up(5, 0, A) | ||
| while(!done) | ||
| cycle++ | ||
| var/nutritionIncrease = drain * ELECTRICITY_TO_NUTRIMENT_FACTOR | ||
|
|
||
| if(charge + nutritionIncrease > PRETERNIS_LEVEL_FULL) | ||
| nutritionIncrease = max(PRETERNIS_LEVEL_FULL - charge, 0) //if their nutrition goes up from some other source, this could be negative, which would cause bad things to happen. | ||
| drain = nutritionIncrease/ELECTRICITY_TO_NUTRIMENT_FACTOR | ||
|
|
||
| if (do_after(H,15, target = A)) | ||
| var/can_drain = A.can_consume_power_from() | ||
| if(!can_drain || istext(can_drain)) | ||
| if(istext(can_drain)) | ||
| to_chat(H,can_drain) | ||
| done = 1 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| else | ||
| playsound(A.loc, "sparks", 50, 1) | ||
| if(prob(75)) | ||
| spark_system.start() | ||
| var/drained = A.consume_power_from(drain) | ||
| if(drained < drain) | ||
| to_chat(H,"<span class='info'>[A]'s power has been depleted, CONSUME protocol halted.</span>") | ||
| done = 1 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| charge += drained * ELECTRICITY_TO_NUTRIMENT_FACTOR | ||
|
|
||
| if(!done) | ||
| if(charge > (PRETERNIS_LEVEL_FULL -1)) | ||
| to_chat(H,"<span class='info'>CONSUME protocol complete. Physical nourishment refreshed.</span>") | ||
| done = 1 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| else if(cycle % 4 == 0) | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| var/nutperc = round((charge / PRETERNIS_LEVEL_FULL) * 100) | ||
| to_chat(H,"<span class='info'>CONSUME protocol continues. Current satiety level: [nutperc]%.</span>") | ||
| else | ||
| done = 1 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
| qdel(spark_system) | ||
| return 1 | ||
|
|
||
| /atom/proc/can_consume_power_from() | ||
| return 0 //if a string is returned, it will evaluate as false and be output to the person draining. | ||
|
|
||
| /atom/proc/consume_power_from(amount) | ||
| return 0 //return the amount that was drained. | ||
|
|
||
| #define MIN_DRAINABLE_POWER 10 | ||
|
|
||
| //CELL// | ||
| /obj/item/stock_parts/cell/can_consume_power_from() | ||
| if(charge < MIN_DRAINABLE_POWER) | ||
| return "<span class='info'>Power cell depleted, CONSUME protocol halted.</span>" | ||
| return 1 | ||
|
|
||
| /obj/item/stock_parts/cell/consume_power_from(amount) | ||
| if((charge - amount) < MIN_DRAINABLE_POWER) | ||
| amount = max(charge - MIN_DRAINABLE_POWER, 0) | ||
| use(amount) | ||
| return amount | ||
|
|
||
| //APC// | ||
| /obj/machinery/power/apc/can_consume_power_from() | ||
| if(!cell) | ||
| return "<span class='info'>APC cell absent, CONSUME protocol halted.</span>" | ||
| if(stat & BROKEN) | ||
| return "<span class='info'>APC is damaged, CONSUME protocol halted.</span>" | ||
| if(!operating || shorted) | ||
| return "<span class='info'>APC main breaker is off, CONSUME protocol halted.</span>" | ||
| if(cell.charge < MIN_DRAINABLE_POWER) | ||
| return "<span class='info'>APC cell depleted, CONSUME protocol halted.</span>" | ||
| return 1 | ||
|
|
||
| /obj/machinery/power/apc/consume_power_from(amount) | ||
| if((cell.charge - amount) < MIN_DRAINABLE_POWER) | ||
| amount = max(cell.charge - MIN_DRAINABLE_POWER, 0) | ||
| cell.use(amount) | ||
| if(charging == 2) | ||
| charging = 0 //if we do not do this here, the APC can get stuck thinking it is fully charged. | ||
| update() | ||
| return amount | ||
|
|
||
| //SMES// | ||
| /obj/machinery/power/smes/can_consume_power_from() | ||
| if(stat & BROKEN) | ||
| return "<span class='info'>SMES is damaged, CONSUME protocol halted.</span>" | ||
| if(!output_attempt) | ||
| return "<span class='info'>SMES is not outputting power, CONSUME protocol halted.</span>" | ||
| if(charge < MIN_DRAINABLE_POWER) | ||
| return "<span class='info'>SMES cells depleted, CONSUME protocol halted.</span>" | ||
| return 1 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
|
|
||
| /obj/machinery/power/smes/consume_power_from(amount) | ||
| if((charge - amount) < MIN_DRAINABLE_POWER) | ||
| amount = max(charge - MIN_DRAINABLE_POWER, 0) | ||
| charge -= amount | ||
| return amount | ||
|
|
||
| //MECH// | ||
| /obj/mecha/can_consume_power_from() | ||
| if(!cell) | ||
| return "<span class='info'>Mech power cell absent, CONSUME protocol halted.</span>" | ||
| if(cell.charge < MIN_DRAINABLE_POWER) | ||
| return "<span class='info'>Mech power cell depleted, CONSUME protocol halted.</span>" | ||
| return 1 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
|
|
||
| /obj/mecha/consume_power_from(amount) | ||
| occupant_message("<span class='danger'>Warning: Unauthorized access through sub-route 4, block H, detected.</span>") | ||
| if((cell.charge - amount) < MIN_DRAINABLE_POWER) | ||
| amount = max(cell.charge - MIN_DRAINABLE_POWER, 0) | ||
| cell.use(amount) | ||
| return amount | ||
|
|
||
| //BORG// | ||
| /mob/living/silicon/robot/can_consume_power_from() | ||
| if(!cell) | ||
| return "<span class='info'>Cyborg power cell absent, CONSUME protocol halted.</span>" | ||
| if(cell.charge < MIN_DRAINABLE_POWER) | ||
| return "<span class='info'>Cyborg power cell depleted, CONSUME protocol halted.</span>" | ||
| return 1 | ||
|
alexkar598 marked this conversation as resolved.
Outdated
|
||
|
|
||
| /mob/living/silicon/robot/consume_power_from(amount) | ||
| src << "<span class='danger'>Warning: Unauthorized access through sub-route 12, block C, detected.</span>" | ||
| if((cell.charge - amount) < MIN_DRAINABLE_POWER) | ||
| amount = max(cell.charge - MIN_DRAINABLE_POWER, 0) | ||
| cell.use(amount) | ||
| return amount | ||
|
|
||
| #undef MIN_DRAINABLE_POWER | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.