Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions modular_doppler/modular_vending/code/tg_vendors/sectech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
/obj/item/ammo_casing/alacran_dart/rootbeer = 3,
/obj/item/storage/box/alacran_dart = 3,
/obj/item/storage/box/alacran_dart/piercing = 3,
/obj/item/storage/toolbox/guncase/modular/sportsco_large_case = 2,
/obj/item/storage/toolbox/guncase/modular/sportsco_small_case = 2,
/obj/item/book/granter/tactical_gun_tosser = 1,
)
premium_doppler = list(
/obj/item/gun/ballistic/automatic/schiebenmaschine = 30,
/obj/item/gun/ballistic/avispa_stingball_shooter = 5,
/obj/item/gun/ballistic/alacran = 5,
/obj/item/knife/combat/survival = 3,
/obj/item/reagent_containers/cup/soda_cans/monkey_energy = 5,
/obj/item/reagent_containers/cup/soda_cans/grey_bull = 5,
Expand Down
340 changes: 340 additions & 0 deletions modular_doppler/modular_weapons/code/cybersun_lasers/laser_guns.dm

Large diffs are not rendered by default.

213 changes: 213 additions & 0 deletions modular_doppler/modular_weapons/code/cybersun_lasers/mode_datums.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
// Yeah I'm using datums for this, because the code on a regular gun would suck huge
// Holds a lot of information that will be applied ot the gun, as well as info that the gun will read later
// This basetype is applies to the base 2 burst laser kill mode for the large laser gun
/datum/laser_weapon_mode
/// What name does this weapon mode have? Will appear in the weapon's radial menu
var/name = "Kill"
/// What casing does this variant of weapon use?
var/obj/item/ammo_casing/casing = /obj/item/ammo_casing/energy/cybersun_big_kill
/// What icon_state does this weapon mode use?
var/weapon_icon_state = "kill"
/// How many charge sections does this variant of weapon have?
var/charge_sections = 5
/// What is the shot cooldown this variant applies to the weapon?
var/shot_delay = 0.3 SECONDS
/// What json string do we check for when making chat messages with this mode?
var/json_speech_string = "kill"
/// What do we change the gun's runetext color to when applied
var/gun_runetext_color = "#cd4456"
/// Are we considered a 'lethal' mode for purposes of the license upgrade?
var/lethal_mode = TRUE

/// Applies some of the universal stats from the variables above
/datum/laser_weapon_mode/proc/apply_stats(obj/item/gun/energy/modular_laser_rifle/applied_gun)
if(applied_gun.default_selected_mode == name)
return
if(length(applied_gun.ammo_type))
for(var/found_casing as anything in applied_gun.ammo_type)
applied_gun.ammo_type.Remove(found_casing)
qdel(found_casing)
applied_gun.ammo_type.Add(casing)
applied_gun.update_ammo_types()
applied_gun.charge_sections = charge_sections
applied_gun.fire_delay = shot_delay
var/new_icon_state = "[applied_gun.base_icon_state]_[weapon_icon_state]"
applied_gun.icon_state = new_icon_state
applied_gun.inhand_icon_state = new_icon_state
applied_gun.worn_icon_state = new_icon_state
applied_gun.update_appearance()
applied_gun.chat_color = gun_runetext_color
applied_gun.chat_color_darkened = process_chat_color(gun_runetext_color, sat_shift = 0.85, lum_shift = 0.85)

/// Stuff applied to the passed gun when the weapon mode is given to the gun
/datum/laser_weapon_mode/proc/apply_to_weapon(obj/item/gun/energy/applied_gun)
applied_gun.burst_size = 2

/// Stuff applied to the passed gun when the weapon mode is removed from the gun
/datum/laser_weapon_mode/proc/remove_from_weapon(obj/item/gun/energy/applied_gun)
applied_gun.burst_size = 1

// Marksman mode for the large laser, adds a scope, slower firing rate, and really quick projectiles
/datum/laser_weapon_mode/marksman
name = "Marksman"
casing = /obj/item/ammo_casing/energy/cybersun_big_sniper
weapon_icon_state = "sniper"
shot_delay = 2 SECONDS
json_speech_string = "sniper"
gun_runetext_color = "#f8d860"
/// Keeps track of the scope component for deleting later
var/datum/component/scope/scope_component

/datum/laser_weapon_mode/marksman/apply_to_weapon(obj/item/gun/energy/applied_gun)
scope_component = applied_gun.AddComponent(/datum/component/scope, 3)

/datum/laser_weapon_mode/marksman/remove_from_weapon(obj/item/gun/energy/applied_gun)
QDEL_NULL(scope_component)

// Windup autofire disabler mode for the large laser
/datum/laser_weapon_mode/disabler_machinegun
name = "Disable"
casing = /obj/item/ammo_casing/energy/cybersun_big_disabler
weapon_icon_state = "disabler"
charge_sections = 2
shot_delay = 0.25 SECONDS
json_speech_string = "disable"
gun_runetext_color = "#47a1b3"
lethal_mode = FALSE
/// Keeps track of the autofire component for deleting later
var/datum/component/automatic_fire/autofire_component

/datum/laser_weapon_mode/disabler_machinegun/apply_to_weapon(obj/item/gun/energy/applied_gun)
autofire_component = applied_gun.AddComponent(/datum/component/automatic_fire, shot_delay)

/datum/laser_weapon_mode/disabler_machinegun/remove_from_weapon(obj/item/gun/energy/applied_gun)
QDEL_NULL(autofire_component)

// Grenade launching mode for the large laser
/datum/laser_weapon_mode/launcher
name = "Launcher"
casing = /obj/item/ammo_casing/energy/cybersun_big_launcher
weapon_icon_state = "launcher"
charge_sections = 3
shot_delay = 2 SECONDS
json_speech_string = "launcher"
gun_runetext_color = "#77bd5d"

/datum/laser_weapon_mode/launcher/apply_to_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = 2

/datum/laser_weapon_mode/launcher/remove_from_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = initial(applied_gun.recoil)

// Shotgun mode for the large laser
/datum/laser_weapon_mode/shotgun
name = "Shotgun"
casing = /obj/item/ammo_casing/energy/cybersun_big_shotgun
weapon_icon_state = "shot"
charge_sections = 3
shot_delay = 0.75 SECONDS
json_speech_string = "shotgun"
gun_runetext_color = "#7a0bb7"

/datum/laser_weapon_mode/shotgun/apply_to_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = 1

/datum/laser_weapon_mode/shotgun/remove_from_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = initial(applied_gun.recoil)

// Hellfire mode for the small laser
/datum/laser_weapon_mode/hellfire
name = "Incinerate"
casing = /obj/item/ammo_casing/energy/cybersun_small_hellfire
weapon_icon_state = "kill"
charge_sections = 3
shot_delay = 0.4 SECONDS
json_speech_string = "incinerate"
gun_runetext_color = "#cd4456"

/datum/laser_weapon_mode/hellfire/apply_to_weapon(obj/item/gun/energy/applied_gun)
return

/datum/laser_weapon_mode/hellfire/remove_from_weapon(obj/item/gun/energy/applied_gun)
return

// Melee mode for the small laser, yeah this one will be weird
/datum/laser_weapon_mode/sword
name = "Blade"
// This mode doesn't actually shoot but we gotta have a casing regardless so it doesn't runtime times a million
// And also so the visuals work :3
casing = /obj/item/ammo_casing/energy/cybersun_small_blade
weapon_icon_state = "blade"
charge_sections = 2
json_speech_string = "blade"
gun_runetext_color = "#f8d860"
lethal_mode = FALSE // it's worse than the security blade anyway

/datum/laser_weapon_mode/sword/apply_to_weapon(obj/item/gun/energy/modular_laser_rifle/applied_gun)
playsound(src, 'sound/items/unsheath.ogg', 25, TRUE)
applied_gun.force = 18
applied_gun.sharpness = SHARP_EDGED
applied_gun.exposed_wound_bonus = 10
applied_gun.disabled_for_other_reasons = TRUE
applied_gun.attack_verb_continuous = list("slashes", "cuts")
applied_gun.attack_verb_simple = list("slash", "cut")
applied_gun.hitsound = 'sound/items/weapons/rapierhit.ogg'

/datum/laser_weapon_mode/sword/remove_from_weapon(obj/item/gun/energy/modular_laser_rifle/applied_gun)
playsound(src, 'sound/items/sheath.ogg', 25, TRUE)
applied_gun.force = initial(applied_gun.force)
applied_gun.sharpness = initial(applied_gun.sharpness)
applied_gun.exposed_wound_bonus = initial(applied_gun.exposed_wound_bonus)
applied_gun.disabled_for_other_reasons = FALSE
applied_gun.attack_verb_continuous = initial(applied_gun.attack_verb_continuous)
applied_gun.attack_verb_simple = initial(applied_gun.attack_verb_simple)
applied_gun.hitsound = initial(applied_gun.hitsound)

// Flare mode for the small laser
/datum/laser_weapon_mode/flare
name = "Flare"
casing = /obj/item/ammo_casing/energy/cybersun_small_launcher
weapon_icon_state = "flare"
charge_sections = 3
shot_delay = 2 SECONDS
json_speech_string = "flare"
gun_runetext_color = "#77bd5d"

/datum/laser_weapon_mode/flare/apply_to_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = 2

/datum/laser_weapon_mode/flare/remove_from_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = initial(applied_gun.recoil)

// Shotgun mode for the small laser
/datum/laser_weapon_mode/shotgun_small
name = "Shotgun"
casing = /obj/item/ammo_casing/energy/cybersun_small_shotgun
weapon_icon_state = "shot"
charge_sections = 3
shot_delay = 0.6 SECONDS
json_speech_string = "shotgun"
gun_runetext_color = "#7a0bb7"

/datum/laser_weapon_mode/shotgun_small/apply_to_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = 1

/datum/laser_weapon_mode/shotgun_small/remove_from_weapon(obj/item/gun/energy/applied_gun)
applied_gun.recoil = initial(applied_gun.recoil)

// Trickshot bounce disabler mode for the small laser
/datum/laser_weapon_mode/trickshot_disabler
name = "Disable"
casing = /obj/item/ammo_casing/energy/cybersun_small_disabler
weapon_icon_state = "disable"
charge_sections = 3
shot_delay = 0.4 SECONDS
json_speech_string = "disable"
gun_runetext_color = "#47a1b3"
lethal_mode = FALSE

/datum/laser_weapon_mode/trickshot_disabler/apply_to_weapon(obj/item/gun/energy/applied_gun)
return

/datum/laser_weapon_mode/trickshot_disabler/remove_from_weapon(obj/item/gun/energy/applied_gun)
return
Loading
Loading