Skip to content

add: Кучка прикольных механов и твиков для Вринов #6827

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

Open
wants to merge 19 commits into
base: master220
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 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
6 changes: 6 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai

/// A trait gained by leaning against a wall
#define TRAIT_LEANING "leaning"

/// When it's cold you go faster, when it's hotter - slower
#define TRAIT_TEMPERATURE_MOVEMENT "temperature_movement"

/// when pulling you keep your speed same
#define TRAIT_STRONG_PULLING "strong_pulling"
3 changes: 3 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_WINGDINGS" = TRAIT_WINGDINGS,
"TRAIT_XENO_HOST" = TRAIT_XENO_HOST,
"TRAIT_XRAY" = TRAIT_XRAY,
"TRAIT_STRONG_PULLING" = TRAIT_STRONG_PULLING,
"TRAIT_TEMPERATURE_MOVEMENT" = TRAIT_TEMPERATURE_MOVEMENT,
),

/obj/item = list(
"TRAIT_NEEDS_TWO_HANDS" = TRAIT_NEEDS_TWO_HANDS,
"TRAIT_NODROP" = TRAIT_NODROP,
Expand Down
194 changes: 189 additions & 5 deletions code/game/objects/structures/wryn.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#define WRYN_WAX_DAMAGE 15

/obj/structure/wryn
max_integrity = 100
var/damage = 0
var/modifier = 0

/obj/structure/wryn/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
Expand All @@ -12,9 +16,20 @@
if(damage_amount)
playsound(loc, 'sound/items/welder.ogg', 100, TRUE)

/obj/structure/wryn/attack_hand(mob/living/user)
var/obj/structure/wryn/target
if(iswryn(user))
if(user.a_intent == INTENT_HARM)
take_damage(WRYN_WAX_DAMAGE, BRUTE, 0, 'sound/effects/attackblob.ogg')
user.do_attack_animation(target)
else
return

// wax structures procs

/obj/structure/wryn/wax
name = "wax"
desc = "Looks like some kind of thick wax."
desc = "Похоже на толстую стенку из воска."
icon = 'icons/obj/smooth_structures/wryn/wall.dmi'
icon_state = "wall"
base_icon_state = "wall"
Expand Down Expand Up @@ -46,15 +61,17 @@
/obj/structure/wryn/wax/CanAtmosPass(turf/T, vertical)
return !density

// Structure themselfs

/obj/structure/wryn/wax/wall
name = "wax wall"
desc = "Thick wax solidified into a wall."
desc = "Толстая, наложенная слой за слоем, стенка из воска."
smoothing_groups = SMOOTH_GROUP_WRYN_WAX_WALL + SMOOTH_GROUP_WRYN_WAX_WINDOW
obj_flags = BLOCK_Z_IN_DOWN | BLOCK_Z_IN_UP

/obj/structure/wryn/wax/window
name = "wax window"
desc = "Wax just thin enough to let light pass through."
desc = "Воск на этой стенке настолько тонкий, что через него может проходить свет."
icon = 'icons/obj/smooth_structures/wryn/window.dmi'
base_icon_state = "window"
icon_state = "window-0"
Expand All @@ -66,17 +83,19 @@
icon = 'icons/obj/smooth_structures/wryn/floor.dmi'
gender = PLURAL
name = "wax floor"
desc = "A sticky yellow surface covers the floor."
desc = "Какая-то жёлтая, липкая половица... Так, стоп...."
anchored = TRUE
density = FALSE
layer = TURF_LAYER
plane = FLOOR_PLANE
icon_state = "wax_floor"
var/list/icons = list("wax_floor1", "wax_floor2", "wax_floor3")
icon_state = "wax_floor1"
max_integrity = 10
var/current_dir
var/static/list/floorImageCache
obj_flags = BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP

// wax floor procs

/obj/structure/wryn/floor/update_overlays()
. = ..()
Expand All @@ -100,6 +119,8 @@

/obj/structure/wryn/floor/New(pos)
..()
var/picked = pick(icons)
icon_state = picked
fullUpdateWeedOverlays()

/obj/structure/wryn/floor/Destroy()
Expand All @@ -120,3 +141,166 @@
if(exposed_temperature > 300)
take_damage(5, BURN, 0, 0)

#define WAX_DOOR_CLOSED 0
#define WAX_DOOR_OPENED 1

// wax door procs

/obj/structure/wryn/wax/door
name = "wax door"
desc = "Толстое наложение груд воска, напоминающее подобие двери."
icon = 'icons/obj/smooth_structures/wryn/wax_door.dmi'
icon_state = "wax_door_closed"
max_integrity = 50
canSmoothWith = null
smooth = NONE
pass_flags_self = PASSDOOR
var/state = WAX_DOOR_CLOSED
var/operating = FALSE
var/autoclose = TRUE
var/autoclose_delay = 10 SECONDS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем было изобретать велосипед? У нас уже есть шлюзы. Лучше создавать наследника от них и оверрайдить нужные проки. В текущем виде это лишь одно большое повторение кода



/obj/structure/wryn/wax/door/Initialize()
. = ..()
update_freelook_sight()


/obj/structure/wryn/wax/door/Destroy()
set_density(FALSE)
update_freelook_sight()
return ..()


/obj/structure/wryn/wax/door/update_icon_state()
switch(state)
if(WAX_DOOR_CLOSED)
icon_state = "wax_door_closed"
if(WAX_DOOR_OPENED)
icon_state = "wax_door_opened"

/obj/structure/wryn/wax/door/attack_animal(mob/living/simple_animal/animal)
if(animal.a_intent == INTENT_HARM)
return ..()

return try_switch_state(animal)

/obj/structure/wryn/wax/door/attack_hand(mob/living/user)
if(user.a_intent == INTENT_HARM)
return ..()
if(!iswryn(user))
to_chat(user, span_notice("Вы даже не знаете, что делать с этой грудой воска."))

return try_switch_state(user)

/obj/structure/wryn/wax/door/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
switch_state()

/obj/structure/wryn/wax/door/attack_tk(mob/user)
return

/obj/structure/wryn/wax/door/proc/try_switch_state(atom/movable/user)
if(operating)
return FALSE

add_fingerprint(user)
if(!isliving(user))
return FALSE
// var/mob/living/mob = user
if(!istype(user, /mob/living/carbon/human/wryn))
return FALSE

var/mob/living/carbon/human/wryn/wryn = user
if(wryn.incapacitated())
return FALSE

switch_state()
return TRUE

/obj/structure/wryn/wax/door/proc/switch_state()
switch(state)
if(WAX_DOOR_CLOSED)
open()
if(WAX_DOOR_OPENED)
close()

/obj/structure/wryn/wax/door/proc/open()

if(operating || !density)
return

if(autoclose)
autoclose_in(autoclose_delay)

flick("wax_door_opening", src)
playsound(loc, 'sound/creatures/alien/xeno_door_open.ogg', 100, TRUE)
operating = TRUE

sleep(0.1 SECONDS)
set_opacity(FALSE)
update_freelook_sight()

sleep(0.4 SECONDS)
set_density(FALSE)
air_update_turf(TRUE)

sleep(0.1 SECONDS)
operating = FALSE
state = WAX_DOOR_OPENED
update_icon()


/obj/structure/wryn/wax/door/proc/close()

if(operating || density)
return

var/turf/source_turf = get_turf(src)
for(var/atom/movable/moving_atom in source_turf)
if(moving_atom.density && moving_atom != src)
if(autoclose)
autoclose_in(autoclose_delay * 0.5)
return

flick("wax_door_closing", src)
playsound(loc, 'sound/creatures/alien/xeno_door_close.ogg', 100, TRUE)
operating = TRUE

sleep(0.1 SECONDS)
set_density(TRUE)
air_update_turf(TRUE)

sleep(0.4 SECONDS)
set_opacity(TRUE)
update_freelook_sight()

sleep(0.1 SECONDS)
operating = FALSE
state = WAX_DOOR_CLOSED
update_icon()
check_mobs()


/obj/structure/wryn/wax/door/proc/check_mobs()
if(locate(/mob/living) in get_turf(src))
sleep(0.1 SECONDS)
open()


/obj/structure/wryn/wax/door/proc/autoclose()
if(!QDELETED(src) && !density && !operating && autoclose)
close()


/obj/structure/wryn/wax/door/proc/autoclose_in(wait)
addtimer(CALLBACK(src, PROC_REF(autoclose)), wait, TIMER_UNIQUE | TIMER_NO_HASH_WAIT | TIMER_OVERRIDE)


/obj/structure/wryn/wax/door/proc/update_freelook_sight()
if(GLOB.cameranet)
GLOB.cameranet.updateVisibility(src, opacity_check = FALSE)


#undef WAX_DOOR_CLOSED
#undef WAX_DOOR_OPENED
5 changes: 5 additions & 0 deletions code/modules/mob/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@

return FALSE

/datum/language/wryn/get_random_name()
var/new_name = "[pick(list("Ба", "Бо", "Бу", "Бы", "Ва", "Во", "Вы", "Га", "Го", "Гу", "Да", "До", "Ду", "Ел", "Жа", "Жо", "Жу", "За", "Зо", "Зу", "Ив", "Из", "Ин", "Йо", "Ла", "Ле", "Ли", "Ма", "Му", "Мы", "Тру"))]"
new_name += "[pick(list("ба", "бо", "бу", "бор", "ва", "во", "век", "га", "гор", "ду", "дар", "ел", "жу", "жар", "зо", "зуб", "ив", "изг", "инт", "йод", "ла", "лес", "лим", "ма", "мир", "тыр", "нос", "обл", "орг", "пот", "тень"))]"
return new_name

/datum/language/xenocommon
name = LANGUAGE_XENOS
colour = "alien"
Expand Down
18 changes: 18 additions & 0 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@
stamina_damage += PUSH_STAMINADAM_RUN

apply_damage(stamina_damage, STAMINA)
// if our speed is connected to enviroment temperature
var/datum/gas_mixture/environment
if(HAS_TRAIT(src,TRAIT_TEMPERATURE_MOVEMENT))
environment = loc.return_air()
if(environment.temperature >= 283.15)
remove_movespeed_modifier(/datum/movespeed_modifier/temperature/cold)
add_movespeed_modifier(/datum/movespeed_modifier/temperature/hot)
if(environment.temperature < 283.15)
remove_movespeed_modifier(/datum/movespeed_modifier/temperature/hot)
add_movespeed_modifier(/datum/movespeed_modifier/temperature/cold)

if(!has_gravity())
return .
Expand Down Expand Up @@ -244,6 +254,14 @@

return ..()

/mob/living/carbon/human/update_pull_movespeed()
. = ..()
if(pulling && HAS_TRAIT(src, TRAIT_STRONG_PULLING))
remove_movespeed_modifier(/datum/movespeed_modifier/bulky_drag)

/mob/living/carbon/human/update_push_movespeed()
if(now_pushing && HAS_TRAIT(src, TRAIT_STRONG_PULLING))
remove_movespeed_modifier(/datum/movespeed_modifier/bulky_push)

#undef PULL_STAMINADAM_WALK
#undef PULL_STAMINADAM_RUN
Expand Down
16 changes: 9 additions & 7 deletions code/modules/mob/living/carbon/human/species/wryn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
name_plural = "Wryn"
icobase = 'icons/mob/human_races/r_wryn.dmi'
deform = 'icons/mob/human_races/r_wryn.dmi'
language = LANGUAGE_WRYN
blacklisted = TRUE
tail = "wryntail"
eyes = "wryn_eyes_s"
punchdamagelow = 0
punchdamagehigh = 1
speed_mod = 1
warning_low_pressure = -300
hazard_low_pressure = 1
blurb = "The wryn (r-in, singular r-in) are a humanoid race that possess many bee-like features. Originating from Alveare they \
Expand Down Expand Up @@ -59,6 +59,8 @@
TRAIT_HAS_REGENERATION,
TRAIT_NO_BREATH,
TRAIT_NO_SCAN,
TRAIT_TEMPERATURE_MOVEMENT,
TRAIT_STRONG_PULLING,
)
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
bodyflags = HAS_SKIN_COLOR | HAS_BODY_ACCESSORY
Expand Down Expand Up @@ -117,13 +119,13 @@
return
var/mob/living/carbon/user = owner
if((HAS_TRAIT(user, TRAIT_RESTRAINED) && user.pulledby) || user.buckled) //Is your Wryn restrained, pulled, or buckled? No stinging!
to_chat(user, "<span class='notice'>Вам нужна свобода передвижения, чтобы ужалить кого-то!</span>")
user.balloon_alert(user, "Слишком мало места!")
return
if(user.wear_suit) //Is your Wryn wearing a Hardsuit or a Laboat that's blocking their Stinger?
to_chat(user, "<span class='notice'>Для использования жала нужно снять верхнюю одежду.</span>")
user.balloon_alert(user, "Снимите верхнюю одежду!")
return
if(user.getStaminaLoss() >= 50) //Does your Wryn have enough Stamina to sting?
to_chat(user, "<span class='notice'>Вы слишком устали для использования жала.</span>")
user.balloon_alert(user, "Вы устали!")
return
else
button_on = TRUE
Expand All @@ -147,9 +149,9 @@
var/list/names = list()
for(var/mob/living/carbon/human/M in orange(1))
names += M
var/target = input("Select a Target: ", "Sting Target", null) as null|anything in names
var/target = input("Выберите цель: ", "Цель укуса", null) as null|anything in names
if(!target) //No one's around!
to_chat(user, "<span class='warning'>Вокруг некого жалить! Жало втягивается обратно.</span>")
user.balloon_alert(user, "Вокруг некого жалить!")
user.visible_message("<span class='warning'[user] втягивает своё жало.</span>")
button_on = FALSE
UpdateButtonIcon()
Expand All @@ -163,7 +165,7 @@
/datum/action/innate/wryn_sting/proc/sting_target(mob/living/carbon/human/user, mob/living/carbon/human/target)
button_on = FALSE //For when we Update the Button Icon
if(!(target in orange(1, user))) //Dang, did they get away?
to_chat(user, "<span class='warning'>Вы слишком далеко от [target]. Жало втягивается.</span>")
user.balloon_alert(user, "Слишком далеко от цели!")
user.visible_message("<span class='warning'[user] убирает свое жало.</span>")
UpdateButtonIcon()
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/living_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

if(isliving(pulling))
var/mob/living/pulling_mob = pulling
if(!slowed_by_pull_and_push || pulling_mob.body_position == STANDING_UP || grab_state > GRAB_PASSIVE)
if(!slowed_by_pull_and_push || pulling_mob.body_position == STANDING_UP || grab_state > GRAB_PASSIVE || HAS_TRAIT(src, TRAIT_STRONG_PULLING))
remove_movespeed_modifier(/datum/movespeed_modifier/bulky_drag)
return
if(!pulling_mob.buckled)
Expand Down
11 changes: 11 additions & 0 deletions code/modules/movespeed/modifiers/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,14 @@
/datum/movespeed_modifier/human_carry
multiplicative_slowdown = HUMAN_CARRY_SLOWDOWN
blacklisted_movetypes = FLOATING

/datum/movespeed_modifier/temperature
variable = TRUE
movetypes = GROUND
blacklisted_movetypes = (FLYING)

/datum/movespeed_modifier/temperature/cold
multiplicative_slowdown = -0.2

/datum/movespeed_modifier/temperature/hot
multiplicative_slowdown = 0.5
Loading