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

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 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

Expand Down Expand Up @@ -196,7 +198,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
10 changes: 10 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,16 @@
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"
w_class = SIZE_TINY
m_amt = 30
g_amt = 10
stored_technology = new /datum/technology/tier1_hud_upgrade()


/obj/item/weapon/disk/tech_disk/atom_init()
var/diskcolor = pick(0,1,2,3,4,5,6,7,8)
Expand Down
190 changes: 190 additions & 0 deletions code/modules/item_upgrades/item_upgrade.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
#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 = 0
L4rever marked this conversation as resolved.
Show resolved Hide resolved
hud_types = list(DATA_HUD_SECURITY)
item_action_types = list()
var/upgrade_tier = 0
var/current_mode = null

/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/human/human = usr
L4rever marked this conversation as resolved.
Show resolved Hide resolved
switch(mode_type)
if(HUD_TOGGLEABLE_MODE_NIGHTVISION)
if(enable)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
sightglassesmod = "nightsight"
darkness_view = 7
else
lighting_alpha = null
sightglassesmod = null
darkness_view = 0
if(HUD_TOGGLEABLE_MODE_THERMAL)
if(enable)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
sightglassesmod = "sepia"
vision_flags = SEE_MOBS

else
lighting_alpha = null
sightglassesmod = null
vision_flags = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

страшная копипаста, нельзя вынести это?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Починил, в целом.


if(HUD_TOGGLEABLE_MODE_THERMAL_ADVANCED)
if(enable)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
darkness_view = 7
vision_flags = SEE_MOBS
L4rever marked this conversation as resolved.
Show resolved Hide resolved
else
lighting_alpha = null
darkness_view = 0
vision_flags = 0

playsound(src, activation_sound, VOL_EFFECTS_MASTER, 10, FALSE)
human.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)
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(usr)
L4rever marked this conversation as resolved.
Show resolved Hide resolved
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(usr)
item_actions.Remove(thermal_action)
item_actions.Add(new /datum/action/item_action/hands_free/switch_hud_modes/thermal_advanced(src))

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

/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)
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)
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

/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
49 changes: 49 additions & 0 deletions code/modules/research/designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,15 @@ other types of metals and chemistry for reagents).
build_path = /obj/item/device/hud_calibrator
category = list("Support")

/datum/design/hud_advanced
name = "Advanced HUD"
desc = "An advanced HUD that can be flexibly modified"
id = "advanced_hud"
build_type = PROTOLATHE
materials = list(MAT_METAL = 150, MAT_GLASS = 150)
build_path = /obj/item/clothing/glasses/sunglasses/hud/advanced
category = list("Support")

/////////////////////////////////////////
//////////////////Test///////////////////
/////////////////////////////////////////
Expand Down Expand Up @@ -2879,3 +2888,43 @@ other types of metals and chemistry for reagents).
materials = list(MAT_METAL = 2000, MAT_GLASS = 1000)
build_path = /obj/item/rig_module/emp_shield
category = list("Rig Modules")

/////////////////////////////////////////
////////////////Upgrades/////////////////
/////////////////////////////////////////

/datum/design/tier1_hud_upgrade
name = "Damage Scan Upgrade"
desc = "Allows HUD to show damage on person."
id = "tier1_hud_upgrade"
build_type = PROTOLATHE
materials = list(MAT_METAL = 2000, MAT_GLASS = 1000)
build_path = /obj/item/hud_upgrade/medscan
category = list("Special upgrades")

/datum/design/tier2_hud_upgrade
name = "Basic Nightvision HUD upgrade"
desc = "Allows HUD to turn a basic nightvision mode. Can be installed only after damage scan upgrade"
id = "tier2_hud_upgrade"
build_type = PROTOLATHE
materials = list(MAT_METAL = 4000, MAT_GLASS = 2000, MAT_URANIUM = 2000)
build_path = /obj/item/hud_upgrade/night
category = list("Special upgrades")

/datum/design/tier3_hud_upgrade
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"
id = "tier3_hud_upgrade"
build_type = PROTOLATHE
materials = list(MAT_METAL = 4000, MAT_GLASS = 2000, MAT_PHORON = 2500)
build_path = /obj/item/hud_upgrade/thermal
category = list("Special upgrades")

/datum/design/tier4_hud_upgrade
name = "Advanced Thermal HUD upgrade"
desc = "Makes thermal mode comfortable and combines it with nightvision mode. Can be installed only after thermal upgrade"
id = "tier4_hud_upgrade"
build_type = PROTOLATHE
materials = list(MAT_METAL = 4000, MAT_GLASS = 2000, MAT_GOLD = 1500, MAT_URANIUM = 3000, MAT_PHORON = 3500)
build_path = /obj/item/hud_upgrade/thermal_advanced
category = list("Special upgrades")
12 changes: 12 additions & 0 deletions code/modules/research/rdconsole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ ADD_TO_GLOBAL_LIST(/obj/machinery/computer/rdconsole, RDcomputer_list)
if(istype(D, /obj/item/weapon/disk/research_points))
var/obj/item/weapon/disk/research_points/disk = D
to_chat(user, "<span class='notice'>[name] received [disk.stored_points] research points from [disk.name]</span>")
playsound(src, 'sound/machines/disk-upload.ogg', VOL_EFFECTS_MASTER)
files.research_points += disk.stored_points
user.remove_from_mob(disk)
qdel(disk)
Expand All @@ -146,6 +147,17 @@ ADD_TO_GLOBAL_LIST(/obj/machinery/computer/rdconsole, RDcomputer_list)
files.research_points += research_points
else
to_chat(user, "<span class='notice'>There was no usefull data inside [D.name]'s buffer.</span>")
else if(istype(D, /obj/item/weapon/disk/tech_disk))
var/obj/item/weapon/disk/tech_disk/disk = D
if(disk.stored_technology)
to_chat(user, "<span class='notice'>You succesfully uploaded '[disk.stored_technology.name]' in the console</span>")
playsound(src, 'sound/machines/disk-upload.ogg', VOL_EFFECTS_MASTER)
files.tech_trees[disk.stored_technology.tech_type].shown = TRUE
files.UnlockTechology(disk.stored_technology, TRUE)
user.remove_from_mob(disk)
qdel(disk)
else
to_chat(user, "<span class ='alert'>You can't upload empty disk</span>")
else
//The construction/deconstruction of the console code.
..()
Expand Down
Loading
Loading