Skip to content

Commit

Permalink
add: New gene+new strong effects (#3464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Honker9999999 authored Sep 22, 2023
1 parent e12a1a4 commit e74f90f
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 19 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/genetics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
#define COLOURBLIND "colorblind"
#define MUTE "mute"
#define DEAF "deaf"
#define WEAK "weak"

//Nutrition levels for humans. No idea where else to put it
#define NUTRITION_LEVEL_FAT 600
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/genetics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GLOBAL_VAR_INIT(fatblock, 0)
GLOBAL_VAR_INIT(auld_imperial_block, 0)
GLOBAL_VAR_INIT(swedeblock, 0)
GLOBAL_VAR_INIT(scrambleblock, 0)
GLOBAL_VAR_INIT(strongblock, 0)
GLOBAL_VAR_INIT(weakblock, 0)
GLOBAL_VAR_INIT(hornsblock, 0)
GLOBAL_VAR_INIT(comicblock, 0)

Expand All @@ -58,6 +58,7 @@ GLOBAL_VAR_INIT(empathblock, 0)
GLOBAL_VAR_INIT(immolateblock, 0)
GLOBAL_VAR_INIT(polymorphblock, 0)
GLOBAL_VAR_INIT(silentfootstepsblock, 0)
GLOBAL_VAR_INIT(strongblock, 0)

///////////////////////////////
// /vg/ Mutations
Expand Down
44 changes: 44 additions & 0 deletions code/game/dna/genes/disabilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,47 @@
garbled_message += message[i]
message = garbled_message
return message

/datum/dna/gene/disability/weak
name = "Weak"
desc = "Делает мышцы цели более слабыми."
activation_message = "Вы чуствуете слабость в своих мышцах."
deactivation_message = "Похоже, ваши мышцы снова в норме."
instability = -GENE_INSTABILITY_MODERATE

/datum/dna/gene/disability/weak/New()
..()
block = GLOB.weakblock

/datum/dna/gene/disability/weak/can_activate(mob/M, flags)
if(STRONG in M.mutations)
return FALSE
return ..()

/datum/dna/gene/disability/weak/activate(mob/living/M, connected, flags)
..()
change_strength(M, 1)

/datum/dna/gene/disability/weak/deactivate(mob/living/M, connected, flags)
..()
change_strength(M, -1)

/datum/dna/gene/disability/weak/proc/change_strength(mob/living/M, modifier)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(isvulpkanin(H) || isdrask(H) || isunathi(H))
H.dna.species.punchdamagelow -= (3 * modifier)
H.dna.species.punchdamagehigh -= (4 * modifier)
H.dna.species.strength_modifier -= (0.25 * modifier)
if(isunathi(H))
var/datum/species/unathi/U = H.dna.species
U.tail_strength -= (0.25 * modifier)
return
if(ishumanbasic(H))
H.dna.species.punchdamagelow -= (1 * modifier)
H.dna.species.punchdamagehigh -= (2 * modifier)
H.dna.species.strength_modifier -= (0.1 * modifier)
else
H.dna.species.punchdamagelow -= (2 * modifier)
H.dna.species.punchdamagehigh -= (3 * modifier)
H.dna.species.strength_modifier -= (0.15 * modifier)
13 changes: 0 additions & 13 deletions code/game/dna/genes/goon_disabilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,6 @@
// USELESS SHIT //
//////////////////

// WAS: /datum/bioEffect/strong
/datum/dna/gene/disability/strong
// pretty sure this doesn't do jack shit, putting it here until it does
name = "Strong"
desc = "Enhances the subject's ability to build and retain heavy muscles."
activation_message = "You feel buff!"
deactivation_message = "You feel wimpy and weak."
mutation = STRONG

/datum/dna/gene/disability/strong/New()
..()
block = GLOB.strongblock

// WAS: /datum/bioEffect/horns
/datum/dna/gene/disability/horns
name = "Horns"
Expand Down
47 changes: 47 additions & 0 deletions code/game/dna/genes/goon_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -573,3 +573,50 @@
else if(prob(5) || M.mind?.assigned_role=="Chaplain")
to_chat(M, "<span class='warning'>You sense someone intruding upon your thoughts...</span>")

////////////////////////////////////////////////////////////////////////

// WAS: /datum/bioEffect/strong
/datum/dna/gene/basic/strong
name = "Strong"
desc = "Enhances the subject's ability to build and retain heavy muscles."
activation_messages = list("You feel buff!")
deactivation_messages = list("You feel wimpy and weak.")
instability = GENE_INSTABILITY_MAJOR
mutation = STRONG

/datum/dna/gene/basic/strong/New()
..()
block = GLOB.strongblock

/datum/dna/gene/basic/strong/can_activate(mob/M, flags)
if(WEAK in M.mutations)
return FALSE
return ..()

/datum/dna/gene/basic/strong/activate(mob/living/M, connected, flags)
..()
change_strength(M, 1)

/datum/dna/gene/basic/strong/deactivate(mob/living/M, connected, flags)
..()
change_strength(M, -1)

/datum/dna/gene/basic/strong/proc/change_strength(mob/living/M, modifier)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(isvulpkanin(H) || isdrask(H) || isunathi(H))
H.dna.species.punchdamagelow += (1 * modifier)
H.dna.species.punchdamagehigh += (2 * modifier)
H.dna.species.strength_modifier += (0.1 * modifier)
if(isunathi(H))
var/datum/species/unathi/U = H.dna.species
U.tail_strength += (0.25 * modifier)
return
if(ishumanbasic(H))
H.dna.species.punchdamagelow += (3 * modifier)
H.dna.species.punchdamagehigh += (4 * modifier)
H.dna.species.strength_modifier += (0.25 * modifier)
else
H.dna.species.punchdamagelow += (2 * modifier)
H.dna.species.punchdamagehigh += (3 * modifier)
H.dna.species.strength_modifier += (0.15 * modifier)
3 changes: 2 additions & 1 deletion code/game/gamemodes/setupgame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
GLOB.fatblock = getAssignedBlock("FAT", numsToAssign)
GLOB.swedeblock = getAssignedBlock("SWEDE", numsToAssign)
GLOB.scrambleblock = getAssignedBlock("SCRAMBLE", numsToAssign)
GLOB.strongblock = getAssignedBlock("STRONG", numsToAssign, good=1)
GLOB.weakblock = getAssignedBlock("WEAK", numsToAssign)
GLOB.hornsblock = getAssignedBlock("HORNS", numsToAssign)
GLOB.comicblock = getAssignedBlock("COMIC", numsToAssign)

Expand All @@ -89,6 +89,7 @@
GLOB.immolateblock = getAssignedBlock("IMMOLATE", numsToAssign)
GLOB.empathblock = getAssignedBlock("EMPATH", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.polymorphblock = getAssignedBlock("POLYMORPH", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.strongblock = getAssignedBlock("STRONG", numsToAssign, DNA_HARDER_BOUNDS, good=1)

//
// /vg/ Blocks
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/species/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
var/punchdamagelow = 0 //lowest possible punch damage
var/punchdamagehigh = 9 //highest possible punch damage
var/punchstunthreshold = 9 //damage at which punches from this race will stun //yes it should be to the attacked race but it's not useful that way even if it's logical
var/strength_modifier = 1 //for now only used in resist/grab chances. Maybe sometime it will become more usefull
var/obj_damage = 0
var/list/default_genes = list()

Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/human/species/unathi.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
heatmod = 0.8
coldmod = 1.2
hunger_drain = 0.13
var/tail_strength = 1

blurb = "A heavily reptillian species, Unathi (or 'Sinta as they call themselves) hail from the \
Uuosa-Eso system, which roughly translates to 'burning mother'.<br/><br/>Coming from a harsh, radioactive \
Expand Down Expand Up @@ -110,7 +111,8 @@
user.changeNext_move(CLICK_CD_MELEE) //User бьет С в Е. Сука... С - это цель. Е - это орган.
user.visible_message("<span class='danger'>[user.declent_ru(NOMINATIVE)] хлещет хвостом [C.declent_ru(ACCUSATIVE)] по [E.declent_ru(DATIVE)]! </span>", "<span class='danger'>[pluralize_ru(user.gender,"Ты хлещешь","Вы хлещете")] хвостом [C.declent_ru(ACCUSATIVE)] по [E.declent_ru(DATIVE)]!</span>")
user.adjustStaminaLoss(15)
C.apply_damage(5, BRUTE, E)
var/datum/species/unathi/U = user.dna.species
C.apply_damage(5 * U.tail_strength, BRUTE, E)
user.spin(20, 1)
playsound(user.loc, 'sound/weapons/slash.ogg', 50, 0)
add_attack_logs(user, C, "tail whipped")
Expand Down
16 changes: 13 additions & 3 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -836,22 +836,32 @@
resisting++
switch(G.state)
if(GRAB_PASSIVE)
qdel(G)
if(prob(100 / get_grab_strength(G, src)))
qdel(G)

if(GRAB_AGGRESSIVE)
if(prob(60))
if(prob(60 / get_grab_strength(G, src)))
visible_message("<span class='danger'>[src] has broken free of [G.assailant]'s grip!</span>")
qdel(G)

if(GRAB_NECK)
if(prob(5))
if(prob(5 / get_grab_strength(G, src)))
visible_message("<span class='danger'>[src] has broken free of [G.assailant]'s headlock!</span>")
qdel(G)

if(resisting)
visible_message("<span class='danger'>[src] resists!</span>")
return 1

/mob/living/proc/get_grab_strength(obj/item/grab/G, mob/living/M)
var/modifier = 0
if(ishuman(M))
var/mob/living/carbon/human/H = M
modifier = G.strength / H.dna.species.strength_modifier
else
modifier = G.strength
return modifier

/mob/living/proc/resist_buckle()
spawn(0)
resist_muzzle()
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/mob_grab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
var/allow_upgrade = 1
var/last_upgrade = 0
var/last_hit_zone = 0
var/strength = 1 //how hard is it to get out of this grip
// var/force_down //determines if the affecting mob will be pinned to the ground //disabled due to balance, kept for an example for any new things.
var/dancing //determines if assailant and affecting keep looking at each other. Basically a wrestling position

Expand All @@ -39,6 +40,10 @@
assailant = user
affecting = victim

if(ishuman(user))
var/mob/living/carbon/human/H = user
strength = H.dna.species.strength_modifier

if(affecting.anchored)
qdel(src)
return
Expand Down

0 comments on commit e74f90f

Please sign in to comment.