home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Super Digger
- -- Original Carnage Contest Weapon
- -- Script by DC, February 2010, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.superdigger={}
-
- -- Load & Prepare Ressources
- cc.superdigger.gfx_wpn=loadgfx("weapons/superdigger.bmp") -- Weapon Image
- setmidhandle(cc.superdigger.gfx_wpn)
- cc.superdigger.sfx_attack=loadsfx("digger.wav") -- Attack Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Super Digger
- --------------------------------------------------------------------------------
-
- cc.superdigger.id=addweapon("cc.superdigger","Super Digger",cc.superdigger.gfx_wpn,0) -- Add Weapon (0 uses)
- cc.superdigger.ammo=20 -- 20 Digs
-
- function cc.superdigger.draw() -- Draw
- if cc.superdigger.ammo-weapon_shots>0 then
- setblend(blend_alpha)
- setalpha(1)
- setcolor(255,255,255)
- drawinhand(cc.superdigger.gfx_wpn,7,0)
- -- HUD ammobar
- if cc.superdigger.ammo-weapon_shots>0 then
- hudammobar(cc.superdigger.ammo-weapon_shots,cc.superdigger.ammo)
- end
- -- HUD Crosshair
- hudcrosshair(7,3)
- end
- end
-
- function cc.superdigger.attack(attack) -- Attack
- -- Timer
- if weapon_timer>0 then
- weapon_timer=weapon_timer-1
- end
- if (weapon_shots<cc.superdigger.ammo) and (weapon_timer<=0) then
- if (attack==1) then
- -- Allow weapon switching!
- useweapon(1)
- playsound(cc.superdigger.sfx_attack)
- weapon_shots=weapon_shots+1
- weapon_timer=20
- -- Free Terrain
- terrainexplosion(getplayerx(0)+getplayerdirection(0)*7+math.sin(math.rad(getplayerrotation(0)))*1,getplayery(0)-1-math.cos(math.rad(getplayerrotation(0)))*3,15,2)
- terrainexplosion(getplayerx(0)+getplayerdirection(0)*7+math.sin(math.rad(getplayerrotation(0)))*10,getplayery(0)-1-math.cos(math.rad(getplayerrotation(0)))*10,15,2)
- particle(p_muzzle,getplayerx(0)+getplayerdirection(0)*7+math.sin(math.rad(getplayerrotation(0)))*10,getplayery(0)-1-math.cos(math.rad(getplayerrotation(0)))*10)
- end
- end
- end