forked from shiptest-ss13/Shiptest
-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a26e6e
commit 039a309
Showing
6 changed files
with
80 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Part from "code/modules/projectiles/ammunition/_ammunition.dm" | ||
|
||
// Overrides proc to add check if ammo_box is a shuffler. Allows shufflers to pick up spent ammo | ||
/obj/item/ammo_casing/attackby(obj/item/I, mob/user, params) | ||
if(istype(I, /obj/item/ammo_box)) | ||
var/obj/item/ammo_box/box = I | ||
if(isturf(loc)) | ||
var/boolets = 0 | ||
for(var/obj/item/ammo_casing/bullet in loc) | ||
if (box.stored_ammo.len >= box.max_ammo) | ||
break | ||
if (bullet.BB || box.shuffler) | ||
if (box.give_round(bullet, 0)) | ||
boolets++ | ||
// [CELADON-ADD] - CELADON_BALANCE | ||
playsound(loc, 'sound/weapons/gun/general/mag_bullet_insert.ogg', 60, TRUE) | ||
break | ||
// [/CELADON-ADD] | ||
else | ||
continue | ||
if (boolets > 0) | ||
box.update_appearance() | ||
to_chat(user, "<span class='notice'>You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s.</span>") | ||
else | ||
to_chat(user, "<span class='warning'>You fail to collect anything!</span>") | ||
else | ||
return ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Part from "code/modules/projectiles/boxes_magazines/_box_magazine.dm" | ||
|
||
// Adds "shuffler" variable for spent bullets check | ||
/obj/item/ammo_box | ||
/// used to check for spent ammo when picking up (if true then it will pick up spent ammo) | ||
var/shuffler = FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +0,0 @@ | ||
/obj/item/ammo_box/a12g/shuffler | ||
name = "buckshot shuffler" | ||
desc = "Buckshot magazine with shuffle function. Don't forget your release of liability." | ||
icon = 'mod_celadon/_storge_icons/icons/ammo/ammo.dmi' | ||
base_icon_state = "buckshot_shuffler" | ||
icon_state = "buckshot_shuffler-0" | ||
caliber = "12ga" | ||
ammo_type = /obj/item/ammo_casing/shotgun/buckshot | ||
max_ammo = 8 | ||
start_empty = TRUE | ||
multiple_sprites = AMMO_BOX_PER_BULLET | ||
|
||
var/shuffle_sound = 'sound/weapons/gun/shotgun/insert_shell.ogg' | ||
|
||
shuffler = TRUE | ||
|
||
/obj/item/ammo_box/a12g/shuffler/unique_action(mob/living/user) | ||
stored_ammo = shuffle(stored_ammo) | ||
playsound(src, shuffle_sound, 50, TRUE) | ||
user.visible_message("<span class='notice'>[user] shuffles bullets in [src].</span>", \ | ||
"<span class='notice'>You shuffle bullets in [src].</span>", \ | ||
"<span class='notice'>You hear shuffling sound.</span>") | ||
|
||
/obj/item/ammo_box/a12g/shuffler/examine(mob/user) | ||
. = ..() | ||
. += "Don't load blanks for roulette. They're painful. Load spent shots" | ||
. += "You can shuffle [src] by pressing the <b>unique action</b> key. By default, this is <b>space</b>" | ||
|
||
/datum/design/a12g_shuffler | ||
name = "Buckshot Shuffler" | ||
id = "buckshot_shuffler" | ||
build_type = AUTOLATHE | ||
materials = list(/datum/material/iron = 8000) | ||
build_path = /obj/item/ammo_box/a12g/shuffler | ||
category = list("initial", "Security") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/obj/item/ammo_box/shuffler | ||
name = "ammo shuffler" | ||
desc = "Default ammo shuffler" | ||
|
||
var/shuffle_sound = 'sound/weapons/gun/shotgun/insert_shell.ogg' | ||
|
||
shuffler = TRUE | ||
|
||
/obj/item/ammo_box/shuffler/unique_action(mob/living/user) | ||
stored_ammo = shuffle(stored_ammo) | ||
playsound(src, shuffle_sound, 50, TRUE) | ||
user.visible_message("<span class='notice'>[user] shuffles bullets in [src].</span>", \ | ||
"<span class='notice'>You shuffle bullets in [src].</span>", \ | ||
"<span class='notice'>You hear shuffling sound.</span>") | ||
|
||
/obj/item/ammo_box/shuffler/examine(mob/user) | ||
. = ..() | ||
. += "You can shuffle [src] by pressing the <b>unique action</b> key. By default, this is <b>space</b>" | ||
|
||
/obj/item/ammo_box/shuffler/a12g | ||
name = "buckshot shuffler" | ||
desc = "Buckshot magazine with shuffle function. Don't forget your release of liability." | ||
icon = 'mod_celadon/_storge_icons/icons/ammo/ammo.dmi' | ||
base_icon_state = "buckshot_shuffler" | ||
icon_state = "buckshot_shuffler-0" | ||
caliber = "12ga" | ||
ammo_type = /obj/item/ammo_casing/shotgun/buckshot | ||
max_ammo = 8 | ||
start_empty = TRUE | ||
multiple_sprites = AMMO_BOX_PER_BULLET | ||
|
||
/obj/item/ammo_box/shuffler/a12g/examine(mob/user) | ||
. = ..() | ||
. += "Don't load blanks for roulette. They're painful. Load spent shots" | ||
|
||
/datum/design/a12g_shuffler | ||
name = "Buckshot Shuffler" | ||
id = "buckshot_shuffler" | ||
build_type = AUTOLATHE | ||
materials = list(/datum/material/iron = 8000) | ||
build_path = /obj/item/ammo_box/shuffler/a12g | ||
category = list("initial", "Security") |