Ports TG Pickup, Equip, and Drop Sounds (#15572)

* Ports TG Pickup, Equip, and Drop Sounds

* really
This commit is contained in:
Fox McCloud
2021-02-24 12:51:59 +00:00
committed by GitHub
parent 7b7ea0a191
commit efa3aecb61
95 changed files with 271 additions and 139 deletions
+2
View File
@@ -18,6 +18,8 @@
origin_tech = "magnets=1;engineering=1"
toolspeed = 1
usesound = 'sound/items/deconstruct.ogg'
drop_sound = 'sound/items/handling/component_drop.ogg'
pickup_sound = 'sound/items/handling/component_pickup.ogg'
var/bomb_name = "bomb" // used for naming bombs / mines
+5
View File
@@ -514,6 +514,8 @@ BLIND // can't see anything
var/fire_resist = T0C+100
allowed = list(/obj/item/tank/internals/emergency_oxygen)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
slot_flags = SLOT_OCLOTHING
var/blood_overlay_type = "suit"
var/suittoggled = FALSE
@@ -649,6 +651,9 @@ BLIND // can't see anything
permeability_coefficient = 0.90
slot_flags = SLOT_ICLOTHING
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
equip_sound = 'sound/items/equip/jumpsuit_equip.ogg'
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/uniform.dmi',
@@ -12,6 +12,8 @@
materials = list(MAT_GLASS=500)
max_integrity = 20
resistance_flags = ACID_PROOF
drop_sound = 'sound/items/handling/drinkglass_drop.ogg'
pickup_sound = 'sound/items/handling/drinkglass_pickup.ogg'
/obj/item/reagent_containers/food/drinks/set_APTFT()
set hidden = FALSE
+3 -3
View File
@@ -227,7 +227,7 @@
container_type = OPENCONTAINER
volume = 80
hitsound = 'sound/weapons/jug_empty_impact.ogg'
throwhitsound = 'sound/weapons/jug_empty_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_empty_impact.ogg'
force = 0.2
throwforce = 0.2
@@ -242,10 +242,10 @@
update_icon()
if(reagents.total_volume)
hitsound = 'sound/weapons/jug_filled_impact.ogg'
throwhitsound = 'sound/weapons/jug_filled_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_filled_impact.ogg'
else
hitsound = 'sound/weapons/jug_empty_impact.ogg'
throwhitsound = 'sound/weapons/jug_empty_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_empty_impact.ogg'
/obj/item/reagent_containers/glass/bottle/nutrient/update_icon()
cut_overlays()
+2 -1
View File
@@ -140,7 +140,8 @@
w_class = WEIGHT_CLASS_NORMAL //upped to three because books are, y'know, pretty big. (and you could hide them inside eachother recursively forever)
attack_verb = list("bashed", "whacked")
resistance_flags = FLAMMABLE
drop_sound = 'sound/items/handling/book_drop.ogg'
pickup_sound = 'sound/items/handling/book_pickup.ogg'
var/dat // Actual page content
var/due_date = 0 // Game time in 1/10th seconds
var/author // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
+2 -2
View File
@@ -125,7 +125,7 @@
return 0
return 1
/mob/proc/unEquip(obj/item/I, force) //Force overrides NODROP for things like wizarditis and admin undress.
/mob/proc/unEquip(obj/item/I, force, silent = FALSE) //Force overrides NODROP for things like wizarditis and admin undress.
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
return 1
@@ -146,7 +146,7 @@
if(client)
client.screen -= I
I.forceMove(drop_location())
I.dropped(src)
I.dropped(src, silent)
if(I)
I.layer = initial(I.layer)
I.plane = initial(I.plane)
@@ -1,5 +1,5 @@
//unequip
/mob/living/carbon/alien/humanoid/unEquip(var/obj/item/I, var/force)
/mob/living/carbon/alien/humanoid/unEquip(obj/item/I, force, silent = FALSE)
. = ..(I, force)
if(!. || !I)
return
@@ -1,3 +1,3 @@
//can't unequip since it can't equip anything
/mob/living/carbon/alien/larva/unEquip(obj/item/W as obj, force)
/mob/living/carbon/alien/larva/unEquip(obj/item/I, force, silent = FALSE)
return
+2 -2
View File
@@ -619,7 +619,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
else if(!(I.flags & ABSTRACT)) //can't throw abstract items
thrown_thing = I
unEquip(I)
unEquip(I, silent = TRUE)
if(HAS_TRAIT(src, TRAIT_PACIFISM) && I.throwforce)
to_chat(src, "<span class='notice'>You set [I] down gently on the ground.</span>")
@@ -645,7 +645,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
/mob/living/carbon/get_restraining_item()
return handcuffed
/mob/living/carbon/unEquip(obj/item/I, force) //THIS PROC DID NOT CALL ..()
/mob/living/carbon/unEquip(obj/item/I, force, silent = FALSE) //THIS PROC DID NOT CALL ..()
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
return
@@ -504,6 +504,9 @@ emp_act
//this proc handles being hit by a thrown atom
/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
var/spec_return = dna.species.spec_hitby(AM, src)
if(spec_return)
return spec_return
var/obj/item/I
var/throwpower = 30
if(istype(AM, /obj/item))
@@ -528,8 +531,6 @@ emp_act
visible_message("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
hitpush = FALSE
skipcatch = TRUE //can't catch the now embedded item
if(!blocked)
dna.species.spec_hitby(AM, src)
return ..()
/mob/living/carbon/human/proc/bloody_hands(var/mob/living/source, var/amount = 2)
@@ -74,7 +74,7 @@
if(istype(O) && O.owner == src)
. = 0 // keep a good grip on your heart
/mob/living/carbon/human/unEquip(obj/item/I, force)
/mob/living/carbon/human/unEquip(obj/item/I, force, silent = FALSE)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
@@ -178,7 +178,8 @@
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot)
// Initial is used to indicate whether or not this is the initial equipment (job datums etc) or just a player doing it
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot, initial = FALSE)
if(!slot)
return
if(!istype(I))
@@ -195,7 +196,7 @@
I.screen_loc = null
I.forceMove(src)
I.equipped(src, slot)
I.equipped(src, slot, initial)
I.layer = ABOVE_HUD_LAYER
I.plane = ABOVE_HUD_PLANE
@@ -692,8 +692,6 @@
if(!disable_warning)
to_chat(H, "<span class='alert'>You need a jumpsuit before you can attach this [I.name].</span>")
return FALSE
if(I.slot_flags & SLOT_DENYPOCKET)
return
if(I.w_class <= WEIGHT_CLASS_SMALL || (I.slot_flags & SLOT_POCKET))
return TRUE
if(slot_r_store)
@@ -707,8 +705,6 @@
if(!disable_warning)
to_chat(H, "<span class='alert'>You need a jumpsuit before you can attach this [I.name].</span>")
return FALSE
if(I.slot_flags & SLOT_DENYPOCKET)
return FALSE
if(I.w_class <= WEIGHT_CLASS_SMALL || (I.slot_flags & SLOT_POCKET))
return TRUE
return FALSE
@@ -905,6 +901,7 @@ It'll return null if the organ doesn't correspond, so include null checks when u
return TRUE
/datum/species/proc/spec_hitby(atom/movable/AM, mob/living/carbon/human/H)
return
/datum/species/proc/spec_attacked_by(obj/item/I, mob/living/user, obj/item/organ/external/affecting, intent, mob/living/carbon/human/H)
+23 -29
View File
@@ -100,38 +100,32 @@
//this proc handles being hit by a thrown atom
/mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(istype(AM, /obj/item))
var/obj/item/I = AM
if(isitem(AM))
var/obj/item/thrown_item = AM
var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest
var/dtype = BRUTE
var/volume = I.get_volume_by_throwforce_and_or_w_class()
SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, zone)
dtype = I.damtype
var/nosell_hit = SEND_SIGNAL(thrown_item, COMSIG_MOVABLE_IMPACT_ZONE, src, zone, throwingdatum) // TODO: find a better way to handle hitpush and skipcatch for humans
if(nosell_hit)
skipcatch = TRUE
hitpush = FALSE
if(I.throwforce > 0) //If the weapon's throwforce is greater than zero...
if(I.throwhitsound) //...and throwhitsound is defined...
playsound(loc, I.throwhitsound, volume, TRUE, -1) //...play the weapon's throwhitsound.
else if(I.hitsound) //Otherwise, if the weapon's hitsound is defined...
playsound(loc, I.hitsound, volume, TRUE, -1) //...play the weapon's hitsound.
else if(!I.throwhitsound) //Otherwise, if throwhitsound isn't defined...
playsound(loc, 'sound/weapons/genhit.ogg',volume, TRUE, -1) //...play genhit.ogg.
if(blocked)
return TRUE
else if(!I.throwhitsound && I.throwforce > 0) //Otherwise, if the item doesn't have a throwhitsound and has a throwforce greater than zero...
playsound(loc, 'sound/weapons/genhit1.ogg', volume, 1, -1)//...play genhit1.ogg
if(!I.throwforce)// Otherwise, if the item's throwforce is 0...
playsound(loc, 'sound/weapons/throwtap.ogg', 1, volume, -1)//...play throwtap.ogg.
if(!blocked)
visible_message("<span class='danger'>[src] has been hit by [I].</span>",
"<span class='userdanger'>[src] has been hit by [I].</span>")
var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].", I.armour_penetration)
apply_damage(I.throwforce, dtype, zone, armor, is_sharp(I), I)
if(I.thrownby)
add_attack_logs(I.thrownby, src, "Hit with thrown [I]", !I.throwforce ? ATKLOG_ALMOSTALL : null) // Only message if the person gets damages
else
return 1
else
playsound(loc, 'sound/weapons/genhit.ogg', 50, TRUE, -1)
..()
if(thrown_item.thrownby)
add_attack_logs(thrown_item.thrownby, src, "Hit with thrown [thrown_item]", !thrown_item.throwforce ? ATKLOG_ALMOSTALL : null) // Only message if the person gets damages
if(nosell_hit)
return ..()
visible_message("<span class='danger'>[src] is hit by [thrown_item]!</span>", "<span class='userdanger'>You're hit by [thrown_item]!</span>")
if(!thrown_item.throwforce)
return
var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].", thrown_item.armour_penetration)
apply_damage(thrown_item.throwforce, thrown_item.damtype, zone, armor, is_sharp(thrown_item), thrown_item)
if(QDELETED(src)) //Damage can delete the mob.
return
return ..()
playsound(loc, 'sound/weapons/genhit.ogg', 50, TRUE, -1) //Item sounds are handled in the item itself
return ..()
/mob/living/mech_melee_attack(obj/mecha/M)
@@ -243,7 +243,7 @@
return
/mob/living/silicon/robot/unEquip(obj/item/I, force)
/mob/living/silicon/robot/unEquip(obj/item/I, force, silent = FALSE)
if(I == module_active)
uneq_active(I)
return ..()
@@ -167,7 +167,7 @@
if(M.a_intent == INTENT_HARM)
Bruise()
/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
..()
if(istype(AM, /obj/item))
var/obj/item/T = AM
@@ -495,7 +495,7 @@
return FALSE
return TRUE
/mob/living/simple_animal/equip_to_slot(obj/item/W, slot)
/mob/living/simple_animal/equip_to_slot(obj/item/W, slot, initial = FALSE)
if(!istype(W))
return FALSE
@@ -509,7 +509,7 @@
if(slot_collar)
add_collar(W)
/mob/living/simple_animal/unEquip(obj/item/I, force)
/mob/living/simple_animal/unEquip(obj/item/I, force, silent = FALSE)
. = ..()
if(!. || !I)
return
@@ -262,7 +262,7 @@
Feedon(Food)
return ..()
/mob/living/simple_animal/slime/unEquip(obj/item/I, force)
/mob/living/simple_animal/slime/unEquip(obj/item/I, force, silent = FALSE)
return
/mob/living/simple_animal/slime/start_pulling(atom/movable/AM, state, force = pull_force, show_message = FALSE)
+7 -11
View File
@@ -196,7 +196,7 @@
//This is a SAFE proc. Use this instead of equip_to_slot()!
//set del_on_fail to have it delete W if it fails to equip
//set disable_warning to disable the 'you are unable to equip that' warning.
/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, del_on_fail = 0, disable_warning = 0)
/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, del_on_fail = FALSE, disable_warning = FALSE, initial = FALSE)
if(!istype(W)) return 0
if(!W.mob_can_equip(src, slot, disable_warning))
@@ -208,24 +208,24 @@
return 0
equip_to_slot(W, slot) //This proc should not ever fail.
equip_to_slot(W, slot, initial) //This proc should not ever fail.
return 1
//This is an UNSAFE proc. It merely handles the actual job of equipping. All the checks on whether you can or can't eqip need to be done before! Use mob_can_equip() for that task.
//In most cases you will want to use equip_to_slot_if_possible()
/mob/proc/equip_to_slot(obj/item/W, slot)
/mob/proc/equip_to_slot(obj/item/W, slot, initial = FALSE)
return
//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such.
/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot)
return equip_to_slot_if_possible(W, slot, TRUE, TRUE)
/mob/proc/equip_to_slot_or_del(obj/item/W, slot, initial = FALSE)
return equip_to_slot_if_possible(W, slot, TRUE, TRUE, initial)
// Convinience proc. Collects crap that fails to equip either onto the mob's back, or drops it.
// Used in job equipping so shit doesn't pile up at the start loc.
/mob/living/carbon/human/proc/equip_or_collect(var/obj/item/W, var/slot)
/mob/living/carbon/human/proc/equip_or_collect(obj/item/W, slot, initial = FALSE)
if(W.mob_can_equip(src, slot, 1))
//Mob can equip. Equip it.
equip_to_slot_or_del(W, slot)
equip_to_slot_or_del(W, slot, initial)
else
//Mob can't equip it. Put it their backpack or toss it on the floor
if(istype(back, /obj/item/storage))
@@ -419,8 +419,6 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(slot_flags & SLOT_DENYPOCKET)
return
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_POCKET) )
return 1
if(slot_r_store)
@@ -430,8 +428,6 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(slot_flags & SLOT_DENYPOCKET)
return 0
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_POCKET) )
return 1
return 0
+2
View File
@@ -21,6 +21,8 @@
max_integrity = 50
attack_verb = list("bapped")
dog_fashion = /datum/dog_fashion/head
drop_sound = 'sound/items/handling/paper_drop.ogg'
pickup_sound = 'sound/items/handling/paper_pickup.ogg'
var/header //Above the main body, displayed at the top
var/info //What's actually written on the paper.
var/footer //The bottom stuff before the stamp but after the body
+1 -1
View File
@@ -8,7 +8,7 @@
throwforce = 1
w_class = WEIGHT_CLASS_TINY
var/fire_sound = null //What sound should play when this ammo is fired
var/drop_sound = "casingdrop" //What sound should play when this ammo hits the ground
var/casing_drop_sound = "casingdrop" //What sound should play when this ammo hits the ground
var/caliber = null //Which kind of guns it can be loaded into
var/projectile_type = null //The bullet type to create when New() is called
var/obj/item/projectile/BB = null //The loaded bullet
@@ -135,7 +135,7 @@
desc = "A 12 gauge lead slug."
icon_state = "blshell"
caliber = "shotgun"
drop_sound = 'sound/weapons/gun_interactions/shotgun_fall.ogg'
casing_drop_sound = 'sound/weapons/gun_interactions/shotgun_fall.ogg'
projectile_type = /obj/item/projectile/bullet
materials = list(MAT_METAL=4000)
muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
+1 -1
View File
@@ -35,7 +35,7 @@
if(eject_casing)
AC.loc = get_turf(src) //Eject casing onto ground.
AC.SpinAnimation(10, 1) //next gen special effects
playsound(src, chambered.drop_sound, 100, 1)
playsound(src, chambered.casing_drop_sound, 100, 1)
if(empty_chamber)
chambered = null
chamber_round()
@@ -57,7 +57,7 @@
if(chambered)//We have a shell in the chamber
chambered.loc = get_turf(src)//Eject casing
chambered.SpinAnimation(5, 1)
playsound(src, chambered.drop_sound, 60, 1)
playsound(src, chambered.casing_drop_sound, 60, 1)
chambered = null
/obj/item/gun/projectile/shotgun/proc/pump_reload(mob/M)
+1 -1
View File
@@ -138,7 +138,7 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "saw3"
hitsound = 'sound/weapons/circsawhit.ogg'
throwhitsound = 'sound/weapons/pierce.ogg'
mob_throw_hit_sound = 'sound/weapons/pierce.ogg'
flags = CONDUCT
force = 15.0
sharp = 1