Merge pull request #3028 from Zuhayr/master

Pneumatic cannon, vox sprite fixes, commits from master.
This commit is contained in:
Chinsky
2013-06-10 19:25:54 -07:00
16 changed files with 170 additions and 21 deletions
+1
View File
@@ -1099,6 +1099,7 @@
#include "code\modules\projectiles\guns\energy\temperature.dm"
#include "code\modules\projectiles\guns\projectile\automatic.dm"
#include "code\modules\projectiles\guns\projectile\pistol.dm"
#include "code\modules\projectiles\guns\projectile\pneumatic.dm"
#include "code\modules\projectiles\guns\projectile\revolver.dm"
#include "code\modules\projectiles\guns\projectile\shotgun.dm"
#include "code\modules\projectiles\projectile\animate.dm"
+1 -1
View File
@@ -313,7 +313,7 @@
desc = "Could probably be used as ... a throwing weapon?"
w_class = 1.0
force = 5.0
throwforce = 15.0
throwforce = 8.0
item_state = "shard-glass"
g_amt = 3750
attack_verb = list("stabbed", "slashed", "sliced", "cut")
+3 -3
View File
@@ -21,10 +21,10 @@
//Detective Work, used for the duplicate data points kept in the scanners
var/list/original_atom
/atom/proc/throw_impact(atom/hit_atom)
/atom/proc/throw_impact(atom/hit_atom, var/speed)
if(istype(hit_atom,/mob/living))
var/mob/living/M = hit_atom
M.hitby(src)
M.hitby(src,speed)
log_attack("<font color='red'>[hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])</font>")
@@ -32,7 +32,7 @@
var/obj/O = hit_atom
if(!O.anchored)
step(O, src.dir)
O.hitby(src)
O.hitby(src,speed)
else if(isturf(hit_atom))
var/turf/T = hit_atom
+8 -8
View File
@@ -44,18 +44,18 @@
return 1
return 0
/atom/movable/proc/hit_check()
/atom/movable/proc/hit_check(var/speed)
if(src.throwing)
for(var/atom/A in get_turf(src))
if(A == src) continue
if(istype(A,/mob/living))
if(A:lying) continue
src.throw_impact(A)
src.throw_impact(A,speed)
if(src.throwing == 1)
src.throwing = 0
if(isobj(A))
if(A.density && !A.throwpass) // **TODO: Better behaviour for windows which are dense, but shouldn't always stop movement
src.throw_impact(A)
src.throw_impact(A,speed)
src.throwing = 0
/atom/movable/proc/throw_at(atom/target, range, speed)
@@ -97,7 +97,7 @@
if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
break
src.Move(step)
hit_check()
hit_check(speed)
error += dist_x
dist_travelled++
dist_since_sleep++
@@ -109,7 +109,7 @@
if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
break
src.Move(step)
hit_check()
hit_check(speed)
error -= dist_y
dist_travelled++
dist_since_sleep++
@@ -126,7 +126,7 @@
if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
break
src.Move(step)
hit_check()
hit_check(speed)
error += dist_y
dist_travelled++
dist_since_sleep++
@@ -138,7 +138,7 @@
if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
break
src.Move(step)
hit_check()
hit_check(speed)
error -= dist_x
dist_travelled++
dist_since_sleep++
@@ -150,7 +150,7 @@
//done throwing, either because it hit something or it finished moving
src.throwing = 0
if(isobj(src)) src:throw_impact(get_turf(src))
if(isobj(src)) src:throw_impact(get_turf(src),speed)
//Overlays
+1 -1
View File
@@ -84,7 +84,7 @@
if(istype(src.beaker, /obj/item/weapon/reagent_containers/blood))
// speed up transfer on blood packs
transfer_amount = 4
attached.inject_blood(beaker,transfer_amount)
src.beaker.reagents.trans_to(src.attached, transfer_amount)
update_icon()
// Take blood
@@ -37,11 +37,12 @@
/obj/structure/stool/MouseDrop(atom/over_object)
if (istype(over_object, /mob/living/carbon/human))
var/mob/living/carbon/human/H = over_object
var/obj/item/weapon/stool/S = new/obj/item/weapon/stool()
S.origin = src
src.loc = S
H.put_in_hands(S)
H.visible_message("\red [H] grabs [src] from the floor!", "\red You grab [src] from the floor!")
if (!H.restrained() && !H.stat && in_range(src, over_object))
var/obj/item/weapon/stool/S = new/obj/item/weapon/stool()
S.origin = src
src.loc = S
H.put_in_hands(S)
H.visible_message("\red [H] grabs [src] from the floor!", "\red You grab [src] from the floor!")
/obj/item/weapon/stool
name = "stool"
@@ -56,6 +56,8 @@
allowed = list(/obj/item/weapon/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword,/obj/item/weapon/handcuffs,/obj/item/weapon/tank)
slowdown = 2
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30)
heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECITON_TEMPERATURE
/obj/item/clothing/head/helmet/space/vox/carapace
name = "alien visor"
@@ -63,6 +65,7 @@
item_state = "vox-carapace"
desc = "A glowing visor, perhaps stolen from a depressed Cylon."
armor = list(melee = 60, bullet = 50, laser = 30, energy = 15, bomb = 30, bio = 30, rad = 30)
flags = HEADCOVERSEYES|STOPSPRESSUREDMAGE
/obj/item/clothing/suit/space/vox/carapace
name = "alien carapace armour"
+2 -2
View File
@@ -61,7 +61,7 @@
P.on_hit(src, absorb)
return absorb
/mob/living/hitby(atom/movable/AM as mob|obj)//Standardization and logging -Sieve
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed)//Standardization and logging -Sieve
if(istype(AM,/obj/))
var/obj/O = AM
var/zone = ran_zone("chest",75)//Hits a random part of the body, geared towards the chest
@@ -72,7 +72,7 @@
src.visible_message("\red [src] has been hit by [O].")
var/armor = run_armor_check(zone, "melee", "Your armor has protected your [zone].", "Your armor has softened hit to your [zone].")
if(armor < 2)
apply_damage(O.throwforce, dtype, zone, armor, O)
apply_damage(O.throwforce*(speed/5), dtype, zone, armor, O)
if(!O.fingerprintslast)
return
var/client/assailant = directory[ckey(O.fingerprintslast)]
@@ -0,0 +1,140 @@
/obj/item/weapon/storage/pneumatic
name = "pneumatic cannon"
desc = "A large gas-powered cannon."
icon = 'icons/obj/gun.dmi'
icon_state = "pneumatic"
item_state = "pneumatic"
w_class = 4.0
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BELT
max_w_class = 3
max_combined_w_class = 20
var/obj/item/weapon/tank/tank = null // Tank of gas for use in firing the cannon.
var/obj/item/weapon/storage/tank_container = new() // Something to hold the tank item so we don't accidentally fire it.
var/pressure_setting = 10 // Percentage of the gas in the tank used to fire the projectile.
var/possible_pressure_amounts = list(5,10,20,25,50) // Possible pressure settings.
var/minimum_tank_pressure = 10 // Minimum pressure to fire the gun.
var/cooldown = 0 // Whether or not we're cooling down.
var/cooldown_time = 50 // Time between shots.
var/force_divisor = 400 // Force equates to speed. Speed/5 equates to a damage multiplier for whoever you hit.
// For reference, a fully pressurized oxy tank at 50% gas release firing a health
// analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+.
/obj/item/weapon/storage/pneumatic/verb/set_pressure() //set amount of tank pressure.
set name = "Set valve pressure"
set category = "Object"
set src in range(0)
var/N = input("Percentage of tank used per shot:","[src]") as null|anything in possible_pressure_amounts
if (N)
pressure_setting = N
usr << "You dial the pressure valve to [pressure_setting]%."
/obj/item/weapon/storage/pneumatic/verb/eject_tank() //Remove the tank.
set name = "Eject tank"
set category = "Object"
set src in range(0)
if(tank)
usr << "You twist the valve and pop the tank out of [src]."
tank.loc = usr.loc
tank = null
icon_state = "pneumatic"
item_state = "pneumatic"
usr.update_icons()
else
usr << "There's no tank in [src]."
/obj/item/weapon/storage/pneumatic/attackby(obj/item/W as obj, mob/user as mob)
if(!tank && istype(W,/obj/item/weapon/tank))
user.drop_item()
tank = W
tank.loc = src.tank_container
user.visible_message("[user] jams [W] into [src]'s valve and twists it closed.","You jam [W] into [src]'s valve and twist it closed.")
icon_state = "pneumatic-tank"
item_state = "pneumatic-tank"
user.update_icons()
else
..()
/obj/item/weapon/storage/pneumatic/examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return
usr << "The valve is dialed to [pressure_setting]%."
if(tank)
usr << "The tank dial reads [tank.air_contents.return_pressure()] kPa."
else
usr << "Nothing is attached to the tank valve!"
/obj/item/weapon/storage/pneumatic/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
if (istype(target, /obj/item/weapon/storage/backpack ))
return
else if (target.loc == user.loc)
return
else if (locate (/obj/structure/table, src.loc))
return
else if(target == user)
return
if (length(contents) == 0)
user << "There's nothing in [src] to fire!"
return 0
else
spawn(0) Fire(target,user,params)
/obj/item/weapon/storage/pneumatic/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (length(contents) > 0)
if(user.a_intent == "hurt")
user.visible_message("\red <b> \The [user] fires \the [src] point blank at [M]!</b>")
Fire(M,user)
return
else
Fire(M,user)
return
/obj/item/weapon/storage/pneumatic/proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
if (!tank)
user << "There is no gas tank in [src]!"
return 0
if (cooldown)
user << "The chamber hasn't built up enough pressure yet!"
return 0
add_fingerprint(user)
var/turf/curloc = get_turf(user)
var/turf/targloc = get_turf(target)
if (!istype(targloc) || !istype(curloc))
return
var/fire_pressure = (tank.air_contents.return_pressure()/100)*pressure_setting
if (fire_pressure < minimum_tank_pressure)
user << "There isn't enough gas in the tank to fire [src]."
return 0
var/obj/item/object = contents[1]
var/speed = ((fire_pressure*tank.volume)/object.w_class)/force_divisor //projectile speed.
if(speed>80) speed = 80 //damage cap.
user.visible_message("<span class='danger'>[user] fires [src] and launches [object] at [target]!</span>","<span class='danger'>You fire [src] and launch [object] at [target]!</span>")
src.remove_from_storage(object,user.loc)
object.throw_at(target,10,speed)
var/lost_gas_amount = tank.air_contents.total_moles*(pressure_setting/100)
var/datum/gas_mixture/removed = tank.air_contents.remove(lost_gas_amount)
user.loc.assume_air(removed)
cooldown = 1
spawn(cooldown_time)
cooldown = 0
user << "[src]'s gauge informs you it's ready to be fired again."
+1 -1
View File
@@ -12,7 +12,7 @@
var/obj/T = target
var/throwdir = get_dir(firer,target)
T.throw_at(get_edge_target_turf(target, throwdir),10,1)
T.throw_at(get_edge_target_turf(target, throwdir),10,10)
return 1
/*
@@ -104,6 +104,10 @@ datum
for (var/datum/reagent/current_reagent in src.reagent_list)
if (!current_reagent)
continue
if (current_reagent.id == "blood" && ishuman(target))
var/mob/living/carbon/human/H = target
H.inject_blood(my_atom, amount)
continue
var/current_reagent_transfer = current_reagent.volume * part
if(preserve_data)
trans_data = current_reagent.data
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 KiB

After

Width:  |  Height:  |  Size: 275 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 36 KiB