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

Новое дерево технологий #13287

Merged
merged 42 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b42d589
Basic hud upgrades functionality
L4rever Jun 24, 2024
dc839e0
Added override button icon states
AirBlack Jun 24, 2024
1c7c57b
Bassic toggle functionality
AirBlack Jun 24, 2024
4893f7b
Added other functionality for advanced HUD
L4rever Jun 24, 2024
7b45927
Added HUD design, advanced thermals replaces other buttons
L4rever Jun 24, 2024
84bcab1
Special tech tree is now unshown by default
L4rever Jun 25, 2024
61a2cbd
Upgrading huds now in separate proc. Deleted not working properly cod…
L4rever Jun 26, 2024
81daf02
fix item action removal
AirBlack Jun 26, 2024
4bc7270
Merge remote-tracking branch 'upstream/master' into rnd-feature
L4rever Jul 8, 2024
67048a6
Merge remote-tracking branch 'upstream/master' into rnd-feature
L4rever Jul 11, 2024
face44a
Added new icons, sprites and rebalanced designes
L4rever Jul 11, 2024
c0a052d
Added disk with starting technology on derelict
L4rever Jul 12, 2024
4e67c65
Fixed sprites on character
L4rever Jul 12, 2024
5df62a0
Changed one of the derelicts with disk
L4rever Jul 12, 2024
14ecfcb
Probably fix for codelinter
L4rever Jul 12, 2024
7998e59
Super mega fix for codelinter
L4rever Jul 12, 2024
68bfc52
Fixed world sprites
L4rever Jul 14, 2024
f57411c
Added new sprites for upgrade circuits
L4rever Jul 14, 2024
e522a00
Merge remote-tracking branch 'upstream/master' into rnd-feature
L4rever Jul 14, 2024
9529a0c
Update code/modules/item_upgrades/item_upgrade.dm
L4rever Jul 15, 2024
cda1a38
Merge branch 'rnd-feature' of https://github.com/L4rever/TauCetiClass…
L4rever Jul 20, 2024
5138415
Added sound for uploading
L4rever Jul 20, 2024
92359a4
Added sound to all disks
L4rever Jul 20, 2024
1817c8a
mob remove
KatoMarika Aug 8, 2024
858804c
fix for mob remove
KatoMarika Aug 8, 2024
a8ea7fe
fix conflict merge
KatoMarika Aug 12, 2024
087b7cb
Merge branch 'master' of https://github.com/TauCetiStation/TauCetiCla…
L4rever Sep 2, 2024
986c39b
fix conflict
L4rever Sep 2, 2024
675874a
Refactored mode change due to NinjaPikachushka desicion
L4rever Sep 6, 2024
8a14f68
Added special operation tech branch
L4rever Sep 6, 2024
bf206c2
Added disk with tech on 2 maps
L4rever Sep 6, 2024
814790c
Update code/modules/item_upgrades/item_upgrade.dm
L4rever Sep 8, 2024
9f25c98
Update code/modules/item_upgrades/item_upgrade.dm
L4rever Sep 8, 2024
3232706
Update code/modules/item_upgrades/item_upgrade.dm
L4rever Sep 8, 2024
fa180c6
Update code/modules/item_upgrades/item_upgrade.dm
L4rever Sep 8, 2024
b46def1
Review fixes
L4rever Sep 8, 2024
0f0f955
Merge branch 'rnd-feature' of https://github.com/L4rever/TauCetiClass…
L4rever Sep 8, 2024
f4f07db
Makes everything beautiful
L4rever Sep 9, 2024
9166892
Beautiful fix
L4rever Sep 9, 2024
8ab7030
234
L4rever Sep 17, 2024
505e5ad
Some fixes
L4rever Sep 17, 2024
ed399aa
Fix boots design
L4rever Sep 28, 2024
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
1 change: 1 addition & 0 deletions code/__DEFINES/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define RESEARCH_BLUESPACE "bluespace"
#define RESEARCH_ROBOTICS "robotics"
#define RESEARCH_ILLEGAL "illegal"
#define RESEARCH_SPECIAL "special"

// Is used in calculating reliability increase per prototype created.
#define RND_RELIABILITY_EXPONENT 0.75
Expand Down
6 changes: 5 additions & 1 deletion code/_onclick/hud/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
var/button_icon = 'icons/hud/actions.dmi'
var/button_icon_state = "default"
var/background_icon_state = "bg_default"
var/icon/button_overlay_icon = null
var/button_overlay_state = null
Comment on lines +24 to +25
Copy link
Member

Choose a reason for hiding this comment

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

Зачем добавлять новые какие-то иконки, если можно использовать button_icon и button_icon_state? Я так понимаю, потому что background_icon_state использует файл основной иконки, мб тогда и добавить background_icon

Copy link
Contributor Author

@L4rever L4rever Sep 17, 2024

Choose a reason for hiding this comment

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

Мы с киборгом решили что пофиг

var/transparent_when_unavailable = TRUE
var/mob/owner
var/toggleable = FALSE
Expand Down Expand Up @@ -191,7 +193,9 @@

cut_overlays()
var/image/img
if(owner.action_type == AB_ITEM && owner.target)
if(owner.button_overlay_icon && owner.button_overlay_state)
img = image(owner.button_overlay_icon, owner.button_overlay_state)
else if(owner.action_type == AB_ITEM && owner.target)
L4rever marked this conversation as resolved.
Show resolved Hide resolved
var/obj/item/I = owner.target
img = image(I.icon, src , I.icon_state)
else if(owner.button_icon && owner.button_icon_state)
Expand Down
11 changes: 11 additions & 0 deletions code/game/objects/items/weapons/disks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@
m_amt = 30
g_amt = 10
var/datum/tech/stored
var/datum/technology/stored_technology

/obj/item/weapon/disk/tech_disk/hud
name = "HUD tech disk"
desc = "That disk contains design of basic HUD upgrade and advanced HUD blueprint"
stored_technology = new /datum/technology/tier1_hud_upgrade()

/obj/item/weapon/disk/tech_disk/spec_ops
name = "Spec Ops tech disk"
desc = "That disc contains designs and blueprints of Special Operation Forces equipment and ammunition"
stored_technology = new /datum/technology/healer_gun

/obj/item/weapon/disk/tech_disk/atom_init()
var/diskcolor = pick(0,1,2,3,4,5,6,7,8)
Expand Down
52 changes: 52 additions & 0 deletions code/modules/clothing/glasses/glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -445,3 +445,55 @@
return
active = !active
to_chat(usr, "<span class='notice'>You toggle the Noire Mode [active ? "on. Let the investigation begin." : "off."]</span>")

/datum/glasses_mode_type_state

/datum/glasses_mode_type_state/proc/on(obj/item/clothing/glasses/glasses)
return

/datum/glasses_mode_type_state/proc/off(obj/item/clothing/glasses/glasses)
return

/datum/glasses_mode_type_state/thermal
var/sightglassesmod = "thermal"

/datum/glasses_mode_type_state/thermal/sepia
sightglassesmod = "sepia"

/datum/glasses_mode_type_state/thermal/on(obj/item/clothing/glasses/glasses)
glasses.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
glasses.sightglassesmod = sightglassesmod
glasses.vision_flags = SEE_MOBS

/datum/glasses_mode_type_state/thermal/off(obj/item/clothing/glasses/glasses)
glasses.lighting_alpha = null
glasses.sightglassesmod = null
glasses.vision_flags = 0

/datum/glasses_mode_type_state/night
var/sightglassesmod = "night"

/datum/glasses_mode_type_state/night/nightsight
sightglassesmod = "nightsight"

/datum/glasses_mode_type_state/night/on(obj/item/clothing/glasses/glasses)
glasses.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
glasses.sightglassesmod = sightglassesmod
glasses.darkness_view = 7

/datum/glasses_mode_type_state/night/off(obj/item/clothing/glasses/glasses)
glasses.lighting_alpha = null
glasses.sightglassesmod = null
glasses.darkness_view = 0

/datum/glasses_mode_type_state/thermal_advanced

/datum/glasses_mode_type_state/thermal_advanced/on(obj/item/clothing/glasses/glasses)
glasses.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
glasses.darkness_view = 7
glasses.vision_flags = SEE_MOBS

/datum/glasses_mode_type_state/thermal_advanced/off(obj/item/clothing/glasses/glasses)
glasses.lighting_alpha = null
glasses.darkness_view = 0
glasses.vision_flags = 0
169 changes: 169 additions & 0 deletions code/modules/item_upgrades/item_upgrade.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
#define HUD_UPGRADE_MEDSCAN 1
#define HUD_UPGRADE_NIGHTVISION 2
#define HUD_UPGRADE_THERMAL 3
#define HUD_UPGRADE_THERMAL_ADVANCED 4

#define HUD_TOGGLEABLE_MODE_NIGHTVISION "night"
#define HUD_TOGGLEABLE_MODE_THERMAL "thermal"
#define HUD_TOGGLEABLE_MODE_THERMAL_ADVANCED "thermal_adv"

/obj/item/clothing/glasses/sunglasses/hud/advanced
name = "Advanced HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their ID status and health status."
icon = 'icons/obj/clothing/goggles.dmi'
item_state = "sechud"
item_state_inventory = "sechud"
item_state_world = "sechud_w"
body_parts_covered = EYES
hud_types = list(DATA_HUD_SECURITY)
item_action_types = list()
var/upgrade_tier = 0
var/current_mode = null
var/static/list/glasses_states = list(
HUD_TOGGLEABLE_MODE_NIGHTVISION = new /datum/glasses_mode_type_state/night/nightsight,
HUD_TOGGLEABLE_MODE_THERMAL = new /datum/glasses_mode_type_state/thermal/sepia,
HUD_TOGGLEABLE_MODE_THERMAL_ADVANCED = new /datum/glasses_mode_type_state/thermal_advanced,
)

/obj/item/clothing/glasses/sunglasses/hud/advanced/proc/apply_effects(mode_type, enable)
if(!ishuman(usr))
return
L4rever marked this conversation as resolved.
Show resolved Hide resolved
var/mob/living/carbon/glasses_user = usr
var/datum/glasses_mode_type_state/state = glasses_states[mode_type]
if (enable)
state.on()
else
state.off()
playsound(src, activation_sound, VOL_EFFECTS_MASTER, 10, FALSE)
glasses_user.update_sight()
update_item_actions()


/obj/item/clothing/glasses/sunglasses/hud/advanced/proc/switch_mode(mode_type)
if(current_mode)
apply_effects(current_mode, FALSE)
if(current_mode == mode_type)
current_mode = null
return

apply_effects(mode_type, TRUE)
current_mode = mode_type

/obj/item/clothing/glasses/sunglasses/hud/advanced/proc/upgrade_hud(obj/item/hud_upgrade/hud_upgrade, mob/living/user)
switch(hud_upgrade.tier)
if(HUD_UPGRADE_MEDSCAN)
item_state = "mixhud"
item_state_inventory = "mixhud"
item_state_world = "mixhud_w"
hud_types.Add(DATA_HUD_MEDICAL_ADV)
def_hud_types.Add(DATA_HUD_MEDICAL_ADV)
if(HUD_UPGRADE_NIGHTVISION)
item_state = "nvghud"
item_state_inventory = "nvghud"
item_state_world = "nvghud_w"
item_actions.Add(new /datum/action/item_action/hands_free/switch_hud_modes/night(src))
if(HUD_UPGRADE_THERMAL)
item_state = "thermalhud"
item_state_inventory = "thermalhud"
item_state_world = "thermalhud_w"
item_actions.Add(new /datum/action/item_action/hands_free/switch_hud_modes/thermal(src))
if(HUD_UPGRADE_THERMAL_ADVANCED)
item_state = "thermalhudadv"
item_state_inventory = "thermalhudadv"
item_state_world = "thermalhudadv_w"
for(var/datum/action/item_action/hands_free/switch_hud_modes/night/night_action in item_actions)
night_action.Remove(user)
item_actions.Remove(night_action)
for(var/datum/action/item_action/hands_free/switch_hud_modes/thermal/thermal_action in item_actions)
thermal_action.Remove(user)
item_actions.Remove(thermal_action)
item_actions.Add(new /datum/action/item_action/hands_free/switch_hud_modes/thermal_advanced(src))
L4rever marked this conversation as resolved.
Show resolved Hide resolved

upgrade_tier = hud_upgrade.tier
update_world_icon()
add_item_actions(user)

/obj/item/clothing/glasses/sunglasses/hud/advanced/attackby(obj/item/W, mob/living/user)
if(istype(W, /obj/item/hud_upgrade))
var/obj/item/hud_upgrade/hud_upgrade = W
if(upgrade_tier >= hud_upgrade.tier)
to_chat(usr, "<span class='notice'>You've already installed that upgrade</span>")
return
if(upgrade_tier < hud_upgrade.tier - 1)
to_chat(usr, "<span class='alert'>You have to install previous upgrades</span>")
return
if(user.is_in_hands(src))
upgrade_hud(hud_upgrade, user)
add_item_actions(user)
else
to_chat(usr, "<span class='alert'>You have to hold huds in hands to upgrade it</span>")
return
qdel(hud_upgrade)
L4rever marked this conversation as resolved.
Show resolved Hide resolved
if(istype(W, /obj/item/device/hud_calibrator))
L4rever marked this conversation as resolved.
Show resolved Hide resolved
var/obj/item/device/hud_calibrator = W
to_chat(usr, "<span class='alert'>You try to recalibrate huds, but nothing happens</span>")
qdel(hud_calibrator)
L4rever marked this conversation as resolved.
Show resolved Hide resolved
L4rever marked this conversation as resolved.
Show resolved Hide resolved
L4rever marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
L4rever marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/hud_upgrade
icon = 'icons/obj/item_upgrades.dmi'
var/tier = 0
/obj/item/hud_upgrade/medscan
name = "Damage Scan Upgrade"
desc = "Allows HUD to show damage on person."
item_state_inventory = "medscan"
item_state_world = "medscan_w"
tier = 1
/obj/item/hud_upgrade/night
name = "Basic Nightvision HUD upgrade"
desc = "Allows HUD to turn a basic nightvision mode. Can be installed only after damage scan upgrade"
item_state_inventory = "nightvision"
item_state_world = "nightvision_w"
tier = 2
/obj/item/hud_upgrade/thermal
name = "Thermal HUD upgrade"
desc = "Allows HUD to turn a basic thermal mode, makes nightvision mode more comfortable for use. Can be installed only after basic nightvision upgrade"
item_state_inventory = "thermal"
item_state_world = "thermal_w"
tier = 3
/obj/item/hud_upgrade/thermal_advanced
name = "Advanced Thermal HUD upgrade"
desc = "Makes thermal mode comfortable and combines it with nightvision mode. Can be installed only after thermal upgrade"
item_state_inventory = "thermaladv"
item_state_world = "thermaladv_w"
tier = 4
L4rever marked this conversation as resolved.
Show resolved Hide resolved
L4rever marked this conversation as resolved.
Show resolved Hide resolved

/datum/action/item_action/hands_free/switch_hud_modes
name = "Switch Mode"
button_overlay_icon = 'icons/obj/clothing/goggles.dmi'
var/hud_mode

/datum/action/item_action/hands_free/switch_hud_modes/Activate()
var/obj/item/clothing/glasses/sunglasses/hud/advanced/hud = target
if(!hud_mode || !istype(hud))
return

hud.switch_mode(hud_mode)

/datum/action/item_action/hands_free/switch_hud_modes/night
name = "Toggle Nightvision"
button_overlay_state = "nvghud"
hud_mode = HUD_TOGGLEABLE_MODE_NIGHTVISION

/datum/action/item_action/hands_free/switch_hud_modes/thermal //only thermal
name = "Toggle thermal"
button_overlay_state = "thermalhud"
hud_mode = HUD_TOGGLEABLE_MODE_THERMAL

/datum/action/item_action/hands_free/switch_hud_modes/thermal_advanced //mixed thermal and nightvision
name = "Toggle Advanced Thermal"
button_overlay_state = "thermalhudadv"
hud_mode = HUD_TOGGLEABLE_MODE_THERMAL_ADVANCED

#undef HUD_UPGRADE_MEDSCAN
#undef HUD_UPGRADE_NIGHTVISION
#undef HUD_UPGRADE_THERMAL
#undef HUD_UPGRADE_THERMAL_ADVANCED
#undef HUD_TOGGLEABLE_MODE_NIGHTVISION
#undef HUD_TOGGLEABLE_MODE_THERMAL
#undef HUD_TOGGLEABLE_MODE_THERMAL_ADVANCED
Loading
Loading