Massive traitor item overhaul

This commit is contained in:
ZomgPonies
2013-09-23 05:41:53 -04:00
parent 3720a8d690
commit b0aff645a3
52 changed files with 1530 additions and 647 deletions
@@ -74,6 +74,12 @@
projectile_type = "/obj/item/projectile/bullet/weakbullet"
m_amt = 500
/obj/item/ammo_casing/shotgun/fakebeanbag
name = "beanbag shell"
desc = "A weak beanbag shell."
icon_state = "bshell"
projectile_type = "/obj/item/projectile/bullet/weakbullet/booze"
m_amt = 12500
/obj/item/ammo_casing/shotgun/stunshell
name = "stun shell"
@@ -7,11 +7,13 @@
origin_tech = "combat=2;materials=2"
ammo_type = "/obj/item/ammo_casing/c38"
var/perfect = 0
special_check(var/mob/living/carbon/human/M)
if(caliber == initial(caliber))
return 1
if(prob(70 - (loaded.len * 10))) //minimum probability of 10, maximum of 60
if(!perfect && prob(70 - (loaded.len * 10))) //minimum probability of 10, maximum of 60
M << "<span class='danger'>[src] blows up in your face.</span>"
M.take_organ_damage(0,20)
M.drop_item()
@@ -52,8 +54,14 @@
return 1
attackby(var/obj/item/A as obj, mob/user as mob)
var/obj/item/weapon/conversion_kit/CK
..()
if(istype(A, /obj/item/weapon/screwdriver))
if(isscrewdriver(A) || istype(A, /obj/item/weapon/conversion_kit))
if(istype(A, /obj/item/weapon/conversion_kit))
CK = A
if(!CK.open)
user << "<span class='notice'>This [CK.name] is useless unless you open it first. </span>"
return
if(caliber == "38")
user << "<span class='notice'>You begin to reinforce the barrel of [src].</span>"
if(loaded.len)
@@ -68,6 +76,8 @@
caliber = "357"
desc = "The barrel and chamber assembly seems to have been modified."
user << "<span class='warning'>You reinforce the barrel of [src]! Now it will fire .357 rounds.</span>"
if(CK && istype(CK))
perfect = 1
else
user << "<span class='notice'>You begin to revert the modifications to [src].</span>"
if(loaded.len)
@@ -82,6 +92,7 @@
caliber = "38"
desc = initial(desc)
user << "<span class='warning'>You remove the modifications on [src]! Now it will fire .38 rounds.</span>"
perfect = 0
@@ -87,7 +87,7 @@
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
loaded -= AC //Remove casing from loaded list.
AC.desc += " This one is spent."
AC.desc = "[initial(AC.desc)] This one is spent."
if(AC.BB)
in_chamber = AC.BB //Load projectile into chamber.
+12 -3
View File
@@ -94,7 +94,15 @@
var/obj/item/weapon/gun/daddy = shot_from //Kinda balanced by fact you need like 2 seconds to aim
if (daddy.target && original in daddy.target) //As opposed to no-delay pew pew
miss_modifier += -30
def_zone = get_zone_with_miss_chance(def_zone, M, -30 + 8*distance)
if(istype(src, /obj/item/projectile/beam/lightning)) //Lightning is quite accurate
miss_modifier += -200
def_zone = get_zone_with_miss_chance(def_zone, M, miss_modifier)
var/turf/simulated/floor/f = get_turf(A.loc)
if(f && istype(f))
f.break_tile()
f.hotspot_expose(1000,CELL_VOLUME)
else
def_zone = get_zone_with_miss_chance(def_zone, M, miss_modifier + 8*distance)
if(!def_zone)
visible_message("\blue \The [src] misses [M] narrowly!")
@@ -143,8 +151,9 @@
O.bullet_act(src)
for(var/mob/M in A)
M.bullet_act(src, def_zone)
density = 0
invisibility = 101
if(!istype(src, /obj/item/projectile/beam/lightning))
density = 0
invisibility = 101
del(src)
return 1
@@ -8,6 +8,166 @@ var/list/beam_master = list()
// icon_states/dirs for each placed beam image
// turfs that have that icon_state/dir
/obj/item/projectile/beam/lightning
invisibility = 101
name = "lightning"
damage = 0
icon = 'icons/obj/lightning.dmi'
icon_state = "lightning"
stun = 10
weaken = 10
stutter = 50
eyeblur = 50
var/tang = 0
layer = 3
var/turf/last = null
kill_count = 6
proc/adjustAngle(angle)
angle = round(angle) + 45
if(angle > 180)
angle -= 180
else
angle += 180
if(!angle)
angle = 1
/*if(angle < 0)
//angle = (round(abs(get_angle(A, user))) + 45) - 90
angle = round(angle) + 45 + 180
else
angle = round(angle) + 45*/
return angle
process()
var/first = 1 //So we don't make the overlay in the same tile as the firer
var/broke = 0
var/broken
var/atom/curr = current
var/Angle=round(Get_Angle(firer,curr))
var/icon/I=new('icons/obj/zap.dmi',"lightning")
I.Turn(Angle)
var/DX=(32*curr.x+curr.pixel_x)-(32*firer.x+firer.pixel_x)
var/DY=(32*curr.y+curr.pixel_y)-(32*firer.y+firer.pixel_y)
var/N=0
var/length=round(sqrt((DX)**2+(DY)**2))
var/count = 0
for(N,N<length,N+=32)
if(count >= kill_count)
break
count++
var/obj/effect/overlay/beam/X=new(loc)
X.BeamSource=src
if(N+32>length)
var/icon/II=new(icon,icon_state)
II.DrawBox(null,1,(length-N),32,32)
II.Turn(Angle)
X.icon=II
else X.icon=I
var/Pixel_x=round(sin(Angle)+32*sin(Angle)*(N+16)/32)
var/Pixel_y=round(cos(Angle)+32*cos(Angle)*(N+16)/32)
if(DX==0) Pixel_x=0
if(DY==0) Pixel_y=0
if(Pixel_x>32)
for(var/a=0, a<=Pixel_x,a+=32)
X.x++
Pixel_x-=32
if(Pixel_x<-32)
for(var/a=0, a>=Pixel_x,a-=32)
X.x--
Pixel_x+=32
if(Pixel_y>32)
for(var/a=0, a<=Pixel_y,a+=32)
X.y++
Pixel_y-=32
if(Pixel_y<-32)
for(var/a=0, a>=Pixel_y,a-=32)
X.y--
Pixel_y+=32
X.pixel_x=Pixel_x
X.pixel_y=Pixel_y
var/turf/TT = get_turf(X.loc)
if(TT == firer.loc)
continue
if(TT.density)
del(X)
break
for(var/atom/O in TT)
if(!O.CanPass(src))
del(X)
broke = 1
break
for(var/mob/living/O in TT.contents)
if(istype(O, /mob/living))
if(O.density)
del(X)
broke = 1
break
if(broke)
if(X)
del(X)
break
spawn
while(src) //Move until we hit something
if(first)
icon = midicon
if((!( current ) || loc == current)) //If we pass our target
broken = 1
icon = endicon
tang = adjustAngle(get_angle(original,current))
if(tang > 180)
tang -= 180
else
tang += 180
icon_state = "[tang]"
var/turf/simulated/floor/f = current
if(f && istype(f))
f.break_tile()
f.hotspot_expose(1000,CELL_VOLUME)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
//world << "deleting"
//del(src) //Delete if it passes the world edge
broken = 1
return
if(kill_count < 1)
//world << "deleting"
//del(src)
broken = 1
kill_count--
//world << "[x] [y]"
if(!bumped && !isturf(original))
if(loc == get_turf(original))
if(!(original in permutated))
icon = endicon
if(!broken)
tang = adjustAngle(get_angle(original,current))
if(tang > 180)
tang -= 180
else
tang += 180
icon_state = "[tang]"
Bump(original)
first = 0
if(broken)
//world << "breaking"
break
else
last = get_turf(src.loc)
step_towards(src, current) //Move~
if(src.loc != current)
tang = adjustAngle(get_angle(src.loc,current))
icon_state = "[tang]"
del(src)
return
/*cleanup(reference) //Waits .3 seconds then removes the overlay.
//world << "setting invisibility"
sleep(50)
src.invisibility = 101
return*/
on_hit(atom/target, blocked = 0)
if(istype(target, /mob/living))
var/mob/living/M = target
M.playsound_local(src, "explosion", 50, 1)
..()
/obj/item/projectile/beam
name = "laser"
icon_state = "laser"
@@ -10,12 +10,32 @@
if (..(target, blocked))
var/mob/living/L = target
shake_camera(L, 3, 2)
return 1
return 0
/obj/item/projectile/bullet/weakbullet
damage = 10
stun = 5
weaken = 5
/obj/item/projectile/bullet/weakbullet/booze
on_hit(var/atom/target, var/blocked = 0)
if(..(target, blocked))
var/mob/living/M = target
M.dizziness += 20
M:slurring += 20
M.confused += 20
M.eye_blurry += 20
M.drowsyness += 20
for(var/datum/reagent/ethanol/A in M.reagents.reagent_list)
M.paralysis += 2
M.dizziness += 10
M:slurring += 10
M.confused += 10
M.eye_blurry += 10
M.drowsyness += 10
A.volume += 5 //Because we can
/obj/item/projectile/bullet/midbullet
damage = 20