Nerfs KA screenshake, moves cit_screenshake.dm to modular_citadel/, and adds a screenshake pref.

This commit is contained in:
deathride58
2017-09-03 05:24:14 -04:00
parent 10d7b0cf56
commit feeb76e472
6 changed files with 76 additions and 45 deletions
-44
View File
@@ -1,44 +0,0 @@
//we vlambeer now
/obj/item/gun/energy
..()
recoil = 0.1
/obj/item/gun/energy/kinetic_accelerator
..()
recoil = 0.8
/obj/item/gun/ballistic
..()
recoil = 0.25
/obj/item/gun/ballistic/shotgun
..()
recoil = 1
/obj/item/gun/ballistic/revolver
..()
recoil = 0.5
/obj/item/gun/ballistic/revolver/doublebarrel
..()
recoil = 1
/obj/item/gun/syringe
..()
recoil = 0.1
/obj/item/pneumatic_cannon/fire_items(turf/target, mob/user)
. = ..()
shake_camera(user, (pressureSetting * 0.75 + 1), (pressureSetting * 0.75))
/obj/item/attack(mob/living/M, mob/living/user)
. = ..()
if(force && force >=11)
shake_camera(user, ((force - 10) * 0.01 + 1), ((force - 10) * 0.01))
shake_camera(M, ((force - 10) * 0.02 + 1), ((force - 10) * 0.02))
/obj/item/attack_obj(obj/O, mob/living/user)
. = ..()
if(force && force >= 20)
shake_camera(user, ((force - 15) * 0.02 + 1), ((force - 15) * 0.02))
+7
View File
@@ -46,6 +46,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/preferred_map = null
var/uses_glasses_colour = 0
var/screenshake = TRUE
//character preferences
var/real_name //our character's name
@@ -361,8 +363,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "Disabled"
else
dat += "High"
dat += "</a><br>"
dat += "<b>Screen shake:</b> <a href='?_src_=prefs;preference=screenshake'>[(screenshake) ? "Full" : "None"]</a><br>"
dat += "</td><td width='300px' height='300px' valign='top'>"
dat += "<h2>Special Role Settings</h2>"
@@ -1486,6 +1491,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
features["exhibitionist"] = TRUE
else
features["exhibitionist"] = FALSE
if("screenshake")
screenshake = !screenshake
if("publicity")
if(unlock_content)
@@ -190,6 +190,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["menuoptions"] >> menuoptions
//citadel code
S["arousable"] >> arousable
S["screenshake"] >> screenshake
//try to fix any outdated data if necessary
if(needs_update >= 0)
@@ -214,6 +215,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
ghost_others = sanitize_inlist(ghost_others, GLOB.ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION)
menuoptions = SANITIZE_LIST(menuoptions)
be_special = SANITIZE_LIST(be_special)
screenshake = sanitize_integer(screenshake, 0, 1, initial(screenshake))
return 1
@@ -256,6 +258,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["tip_delay"], tip_delay)
//citadel code
S["arousable"] << arousable
WRITE_FILE(S["screenshake"], screenshake)
return 1
+3
View File
@@ -0,0 +1,3 @@
Hooray modularity!
Things that modify core files without directly touching said core files go here. This is similar to how Hippie handles things.
This stops dreammaker from throwing errors and warnings if you try to compile these files while they're inside code/citadel/.
+62
View File
@@ -0,0 +1,62 @@
//we vlambeer now
/shake_camera(mob/M, duration, strength=1)//byond's wonky with this shit
if(!M || !M.client || duration <= 0)
return
var/client/C = M.client
if(!C.prefs.screenshake)//possible todo: implement a reduced screenshake setting that cuts screenshake to a quarter of its normal amount? this works perfectly for now, though.
return
var/oldx = C.pixel_x
var/oldy = C.pixel_y
var/max = strength*world.icon_size
var/min = -(strength*world.icon_size)
for(var/i in 0 to duration-1)
if (i == 0)
animate(C, pixel_x=rand(min,max), pixel_y=rand(min,max), time=1)
else
animate(pixel_x=rand(min,max), pixel_y=rand(min,max), time=1)
animate(pixel_x=oldx, pixel_y=oldy, time=1)
/obj/item/gun/energy
..()
recoil = 0.1
/obj/item/gun/energy/kinetic_accelerator
..()
recoil = 0.5
/obj/item/gun/ballistic
..()
recoil = 0.25
/obj/item/gun/ballistic/shotgun
..()
recoil = 1
/obj/item/gun/ballistic/revolver
..()
recoil = 0.5
/obj/item/gun/ballistic/revolver/doublebarrel
..()
recoil = 1
/obj/item/gun/syringe
..()
recoil = 0.1
/obj/item/pneumatic_cannon/fire_items(turf/target, mob/user)
. = ..()
shake_camera(user, (pressureSetting * 0.75 + 1), (pressureSetting * 0.75))
/obj/item/attack(mob/living/M, mob/living/user)
. = ..()
if(force && force >=11)
shake_camera(user, ((force - 10) * 0.01 + 1), ((force - 10) * 0.01))
shake_camera(M, ((force - 10) * 0.015 + 1), ((force - 10) * 0.015))
/obj/item/attack_obj(obj/O, mob/living/user)
. = ..()
if(force && force >= 20)
shake_camera(user, ((force - 15) * 0.01 + 1), ((force - 15) * 0.01))
+1 -1
View File
@@ -2263,7 +2263,7 @@
#include "code\modules\VR\vr_sleeper.dm"
#include "code\modules\zombie\items.dm"
#include "code\modules\zombie\organs.dm"
#include "code\citadel\cit_screenshake.dm"
#include "modular_citadel\cit_screenshake.dm"
#include "interface\interface.dm"
#include "interface\menu.dm"
#include "interface\stylesheet.dm"