Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
WatlerJe committed Aug 10, 2024
2 parents a235bb6 + 45da9b3 commit 5799eee
Show file tree
Hide file tree
Showing 109 changed files with 1,521 additions and 659 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ var/global/list/bitflags = list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define NO_GENDERS "no_genders"
#define NO_SLIP "no_slip"
#define NO_MED_HEALTH_SCAN "no_med_health_scan"
#define NO_WILLPOWER "no_willpower"

//Species Diet Flags
#define DIET_MEAT 1 // Meat.
Expand Down
12 changes: 6 additions & 6 deletions code/__DEFINES/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@
#define TK_MANA_PER_W_CLASS(cl) (2**cl)

//Nutrition levels for humans.
#define NUTRITION_LEVEL_FAT 600
#define NUTRITION_LEVEL_FAT 660
#define NUTRITION_LEVEL_FULL 550
#define NUTRITION_LEVEL_WELL_FED 450
#define NUTRITION_LEVEL_NORMAL 400
#define NUTRITION_LEVEL_FED 350
#define NUTRITION_LEVEL_HUNGRY 250
#define NUTRITION_LEVEL_STARVING 150
#define NUTRITION_LEVEL_WELL_FED 440
#define NUTRITION_LEVEL_NORMAL 330
#define NUTRITION_LEVEL_FED 220
#define NUTRITION_LEVEL_HUNGRY 110
#define NUTRITION_LEVEL_STARVING 50

#define NUTRITION_PERCENT_MAX 120
#define NUTRITION_PERCENT_ZERO 0
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#define STATUS_EFFECT_SWARMS_GIFT /datum/status_effect/swarm_gift

#define STATUS_EFFECT_ALERTNESS /datum/status_effect/alertness

/////////////
// DEBUFFS //
/////////////
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
#define TRAIT_FAST_WALKER "fast_walker"
#define TRAIT_BORK_SKILLCHIP "bork_skillchip"
#define TRAIT_MIMING "miming"
#define TRAIT_WILLPOWER_IMPLANT "willpower_implant"
#define TRAIT_CAN_LEAP "can_leap"

/*
Expand Down
13 changes: 13 additions & 0 deletions code/_onclick/hud/ui_screens/basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@

copy_flags = NONE

/atom/movable/screen/health_doll/Click(location, control, params)
if(!ishuman(usr))
return
var/mob/living/carbon/human/H = usr
var/willpower_amount
if(H.species.flags[NO_WILLPOWER])
willpower_amount = "<span class='boldwarning'>НЕТ</span>"
else
willpower_amount = H.mind.willpower_amount
to_chat(usr, "<span class='notice'>Сила Воли: <b>[willpower_amount]</b>.</span>")

H.mind.do_select_willpower_effect()

/atom/movable/screen/health_doll/add_to_hud(datum/hud/hud)
..()
hud.mymob.healthdoll = src
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/clickplace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
victim.Weaken(5)
victim.apply_damage(8, def_zone = BP_HEAD)
victim.visible_message("<span class='danger'>[assailant] slams [victim]'s face against \the [A]!</span>")
playsound(src, 'sound/weapons/tablehit1.ogg', VOL_EFFECTS_MASTER)
playsound(parent, 'sound/weapons/tablehit1.ogg', VOL_EFFECTS_MASTER)

victim.log_combat(assailant, "face-slammed against \the [parent]")
return FALSE
Expand All @@ -217,7 +217,7 @@
victim.visible_message("<span class='danger'>[assailant] shoves [victim] into [A]!</span>")

step_towards(victim, A)
qdel(src)
qdel(G)
return

assailant.SetNextMove(CLICK_CD_MELEE)
Expand Down
8 changes: 5 additions & 3 deletions code/datums/components/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,13 @@
/datum/component/mood/proc/HandleNutrition()
var/mob/living/L = parent

switch(L.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
var/fullness = L.get_satiation()

switch(fullness)
if(NUTRITION_LEVEL_FAT to INFINITY)
add_event(null, "nutrition", /datum/mood_event/fat)

if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FAT)
add_event(null, "nutrition", /datum/mood_event/wellfed)

if( NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
Expand Down
48 changes: 48 additions & 0 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@
var/creation_time = 0 //World time when this datum was New'd. Useful to tell how long since a character spawned
var/creation_roundtime

var/willpower_amount = 1
var/possible_willpower_effects = list(/datum/willpower_effect/painkiller, /datum/willpower_effect/skills, /datum/willpower_effect/nutrition, /datum/willpower_effect/fat)
var/willpower_effects = list()

/datum/mind/New(key)
src.key = key
creation_time = world.time
creation_roundtime = roundduration2text()
for(var/WE in possible_willpower_effects)
var/i = new WE
willpower_effects += i

/datum/mind/proc/transfer_to(mob/new_character)
for(var/role in antag_roles)
Expand Down Expand Up @@ -707,6 +714,47 @@
all_factions += "-----"
return all_factions

/datum/mind/proc/do_select_willpower_effect()
if(!ishuman(current))
return
var/mob/living/carbon/human/H = current
if(H.species.flags[NO_WILLPOWER])
return
if(H.stat == DEAD)
to_chat(H, "<span class='warning'>Мертвые не своевольничают.</span>")
return
if(!willpower_amount)
to_chat(H, "<span class='warning'>У вас нет воли.</span>")
return
var/datum/willpower_effect/selected_effect
var/list/names = list()
for(var/datum/willpower_effect/WE in willpower_effects)
names += WE.name

var/chosen_willpower_effect = tgui_input_list(H,"Вы собираете волю в кулак...","ВОЛЯ", names)
if(!chosen_willpower_effect)
return

for(var/datum/willpower_effect/selection in willpower_effects)
if(selection.name == chosen_willpower_effect)
selected_effect = selection

use_willpower_effect(selected_effect)

/datum/mind/proc/can_use_willpower_effect(datum/willpower_effect/WE)
if(!ishuman(current))
return
if(willpower_amount < WE.cost)
to_chat(current, "<span class='warning'>Вам не хватает воли.</span>")
return FALSE
return WE.special_check(current)

/datum/mind/proc/use_willpower_effect(datum/willpower_effect/WE)
if(!can_use_willpower_effect(WE))
return FALSE
WE.do_effect(current)
willpower_amount -= WE.cost

/mob/proc/sync_mind()
mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist)
mind.active = 1 //indicates that the mind is currently synced with a client
Expand Down
2 changes: 1 addition & 1 deletion code/datums/outfits/misc/responders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
id = /obj/item/weapon/card/id/centcom/ert/leader
suit_store = /obj/item/weapon/gun/projectile/grenade_launcher/m79

backpack_contents = list(/obj/item/weapon/gun/energy/gun/nuclear, /obj/item/weapon/pinpointer/advpinpointer, /obj/item/device/aicard, /obj/item/device/remote_device/ERT, /obj/item/weapon/storage/box/r4046/rubber, /obj/item/weapon/storage/box/r4046/teargas)
backpack_contents = list(/obj/item/weapon/gun/energy/gun/nuclear, /obj/item/weapon/pinpointer/advpinpointer, /obj/item/device/aicard, /obj/item/device/remote_device/ERT, /obj/item/weapon/storage/box/r4046/rubber, /obj/item/weapon/storage/box/r4046/teargas, /obj/item/weapon/storage/box/handcuffs)

assignment = "Emergency Response Team Leader"

Expand Down
17 changes: 9 additions & 8 deletions code/datums/spawners_menu/spawners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@
var/new_name = sanitize_safe(input(C, "Pick a name", "Name") as null|text, MAX_LNAME_LEN)
C.create_human_apperance(H, new_name)

H.loc = spawnloc
H.key = C.key
H.forceMove(spawnloc)

create_and_setup_role(/datum/role/traitor/dealer, H, TRUE)

Expand Down Expand Up @@ -328,8 +328,8 @@
var/new_name = "[pick(prefixes)] [pick(last_names)]"
C.create_human_apperance(cop, new_name)

cop.loc = spawnloc
cop.key = C.key
cop.forceMove(spawnloc)

//Give antag datum
var/datum/faction/cops/faction = create_uniq_faction(/datum/faction/cops)
Expand Down Expand Up @@ -550,12 +550,12 @@

var/client/C = spectator.client

var/mob/living/carbon/human/H = new(null)
var/mob/living/carbon/human/H = new()
var/new_name = sanitize_safe(input(C, "Pick a name", "Name") as null|text, MAX_LNAME_LEN)
C.create_human_apperance(H, new_name)

H.loc = spawnloc
H.key = C.key
H.forceMove(spawnloc)
H.equipOutfit(/datum/outfit/spy)
H.mind.skills.add_available_skillset(/datum/skillset/max)
H.mind.skills.maximize_active_skills()
Expand Down Expand Up @@ -586,9 +586,10 @@
var/spawnloc = pick_spawn_location()

var/datum/faction/heist/faction = create_uniq_faction(/datum/faction/heist)
var/mob/living/carbon/human/vox/event/vox = new(spawnloc)
var/mob/living/carbon/human/vox/event/vox = new()

vox.key = spectator.client.key
vox.forceMove(spawnloc)

var/sounds = rand(2, 8)
var/newname = ""
Expand Down Expand Up @@ -668,8 +669,8 @@
var/mob/living/carbon/human/H = new(null)
C.create_human_apperance(H)

H.loc = spawnloc
H.key = C.key
H.forceMove(spawnloc)
H.equipOutfit(outfit)
H.mind.skills.add_available_skillset(skillset)
H.mind.skills.maximize_active_skills()
Expand Down Expand Up @@ -710,8 +711,8 @@
var/new_name = "Gorlex Maradeurs Operative"
C.create_human_apperance(H, new_name)

H.loc = spawnloc
H.key = C.key
H.forceMove(spawnloc)

create_and_setup_role(/datum/role/operative/lone, H, TRUE, TRUE)

Expand Down Expand Up @@ -739,8 +740,8 @@
var/new_name = "Wizard The Unbenannt"
INVOKE_ASYNC(spectator.client, TYPE_PROC_REF(/client, create_human_apperance), H, new_name, TRUE)

H.loc = spawnloc
H.key = spectator.client.key
H.forceMove(spawnloc)

var/datum/role/wizard/R = SSticker.mode.CreateRole(/datum/role/wizard, H)
R.rename = FALSE
Expand Down
3 changes: 2 additions & 1 deletion code/datums/spells/in_hand.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@
/obj/item/projectile/neurotoxin/magic
name = "toxin"
damage = 40
weaken = 1
weaken = 4
stun = 1
icon = 'icons/obj/projectiles.dmi'
icon_state = "neurotoxin"
flag = "magic"
Expand Down
16 changes: 16 additions & 0 deletions code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,19 @@
/datum/status_effect/swarm_gift/on_remove()
owner.sight &= ~(SEE_TURFS | SEE_MOBS | SEE_OBJS)
return isreplicator(owner)

/atom/movable/screen/alert/status_effect/alertness
name = "Настороженность"
desc = "Люди используют болы, следует быть осторожнее. Ваши рефлексы повышены."
icon_state = "alertness"

/datum/status_effect/alertness
id = "alertness"
alert_type = /atom/movable/screen/alert/status_effect/alertness
status_type = STATUS_EFFECT_REFRESH

/datum/status_effect/alertness/on_creation(mob/living/new_owner, duration)
. = ..()
if(!.)
return
src.duration = world.time + duration
2 changes: 1 addition & 1 deletion code/datums/uplinks_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@
desc = "The Syndicate surgery dufflebag is a toolkit containing all surgery tools, surgical drapes, \
a MMI, a straitjacket, and a muzzle."
item = /obj/item/weapon/storage/backpack/dufflebag/surgery
cost = 4
cost = 2
uplink_types = list("nuclear", "traitor", "dealer")

/datum/uplink_item/device_tools/c4bag
Expand Down
62 changes: 62 additions & 0 deletions code/datums/willpower_effects.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/datum/willpower_effect
var/name = "Эффект воли"
var/desc = "Крутое описание."
var/cost = 1
var/effect_sound = 'sound/effects/willpower.ogg'

/datum/willpower_effect/proc/special_check(mob/living/carbon/human/user)
return TRUE

/datum/willpower_effect/proc/do_effect(mob/living/carbon/human/user)
user.playsound_local(null, effect_sound, VOL_EFFECTS_MASTER, vary = FALSE, frequency = null, ignore_environment = TRUE)
to_chat(user, desc)

/datum/willpower_effect/painkiller
name = "Превозмочь боль"
desc = "<span class='green bold'>Ваше тело сопротивляется боли.</span>"

/datum/willpower_effect/painkiller/do_effect(mob/living/carbon/human/user)
..()
user.reagents.add_reagent("endorphine", 15)

/datum/willpower_effect/skills
name = "Сосредоточиться на задаче"
desc = "<span class='nicegreen'>Вы сосредотачиваетесь. В течение минуты профессиональные действия будут даваться вам легче.</span>"

/datum/willpower_effect/skills/do_effect(mob/living/carbon/human/user)
..()
var/datum/skillset/willpower/buff = new
user.add_skills_buff(buff, 1 MINUTE)
addtimer(CALLBACK(null, PROC_REF(to_chat), src, "<span class='notice'>Вы теряете концентрацию.</span>"), 1 MINUTE)

/datum/willpower_effect/nutrition
name = "Перетерпеть голод"
desc = "<span class='nicegreen'>Вы стараетесь не обращать внимания на бурчание в животе.</span>"

/datum/willpower_effect/nutrition/special_check(mob/living/carbon/human/user)
if(user.nutrition >= NUTRITION_LEVEL_NORMAL)
to_chat(user, "<span class='notice'>Вы не голодны.</span>")
return FALSE
return TRUE

/datum/willpower_effect/nutrition/do_effect(mob/living/carbon/human/user)
..()
user.nutrition = NUTRITION_LEVEL_WELL_FED

/datum/willpower_effect/fat
name = "Сжечь калории"
desc = "<span class='nicegreen'>Вы напрягаете свой живот, сбрасывая вес по древней скрелльской методике похудания.</span>"

/datum/willpower_effect/fat/special_check(mob/living/carbon/human/user)
if(user.nutrition <= NUTRITION_LEVEL_NORMAL)
to_chat(user, "<span class='notice'>Вы не переели.</span>")
return FALSE
else if(HAS_TRAIT_FROM(user, TRAIT_FAT, ROUNDSTART_TRAIT))
to_chat(user, "<span class='notice'>Вы даже помыслить не можете о том, чтобы сбросить вес.</span>")
return FALSE
return TRUE

/datum/willpower_effect/fat/do_effect(mob/living/carbon/human/user)
..()
user.nutrition = NUTRITION_LEVEL_STARVING+50
user.overeatduration = 0
Loading

0 comments on commit 5799eee

Please sign in to comment.