Try using Notepad++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
-------------------------------------------------------------------------------- -- Script by ZJ, June 2012, USGN=70513 -------------------------------------------------------------------------------- -- Setup Tables if cc==nil then cc={} end cc.sawchain={} -- Load & Prepare Ressources cc.sawchain.gfx_wpn=loadgfx("MyCCelf/chainsaw0.bmp")						-- Weapon Image setmidhandle(cc.sawchain.gfx_wpn) cc.sawchain.gfx_wpn2=loadgfx("MyCCelf/chainsaw1.bmp")						-- Weapon Image setmidhandle(cc.sawchain.gfx_wpn2) cc.sawchain.gfx_pro=loadgfx("MyCCelf/chainsaw_icon.png")						-- Weapon Image setmidhandle(cc.sawchain.gfx_pro) cc.sawchain.sfx_attack=loadsfx("chainsawlaunch.wav")								-- Attack Sound cc.sawchain.sfx_hit=loadsfx("sawcut.ogg")								-- Slice Sound -------------------------------------------------------------------------------- -- Weapon: Chainsaw -------------------------------------------------------------------------------- cc.sawchain.id=addweapon("cc.sawchain","Chainsaw",cc.sawchain.gfx_pro,1,2,"shortrange")	-- Add Weapon function cc.sawchain.draw()												-- Draw 	if weapon_timer>0 then 		weapon_timer=weapon_timer-0.3 	end 	if getplayeraction(0)==0 then 		setblend(blend_alpha) 		setalpha(1) 		setcolor(255,255,255) 		setscale(getplayerdirection(0),1) 		setrotation(0) 		drawimage(cc.sawchain.gfx_wpn,getplayerx(0)+getplayerdirection(0)*(10+weapon_timer),getplayery(0)+3) 	end end function cc.sawchain.attack(attack)										-- Attack 	if (weapon_shots<=0) then 		if (attack==1 and weapon_timer>=0) then 			-- No more weapon switching! 			useweapon(1) 			playsound(cc.sawchain.sfx_attack) 			weapon_shots=weapon_shots+1 			weapon_timer=8 			-- Effect 			particle(p_smoke,getplayerx(0)+3,getplayery(0)+4) 			particlecolor(98,98,98) 			particlespeed(0,-2.0) 			particlefadealpha(0.005) 			particle(p_smoke,getplayerx(0)+3,getplayery(0)-4) 			particlecolor(98,98,98) 			particlespeed(0,-2.0) 			particlefadealpha(0.005) 			particle(p_smoke,getplayerx(0)+3,getplayery(0)-10) 			particlecolor(98,98,98) 			particlespeed(0,-2.0) 			particlefadealpha(0.005) 			-- Hurt Players 			players=playertable(0,0) 			for i=1,#players,1 do 				if i~=playercurrent() then 					if (getplayerx(players[i])>getplayerx(playercurrent()) and getplayerx(players[i])<(getplayerx(playercurrent())+20)) and (getplayery(players[i])>(getplayery(playercurrent())-8) and getplayery(players[i])<(getplayery(playercurrent()+8)) then 						playsound(sfx_splatter2,-1,1.7) 						playerpush(players[i],getplayerdirection(0)*3.0,-1.5) 						playerdamage(players[i],getplayerhealth(players[i])) 						elseif (getplayerhealth(players[i])>=31 and getplayerhealth(players[i])<=65) then 							playerdamage(players[i],getplayerhealth(players[i])*0.85) 						elseif (getplayerhealth(players[i])>=66 and getplayerhealth(players[i])<=100) then 							playerdamage(players[i],getplayerhealth(players[i])*0.65) 						elseif (getplayerhealth(players[i])>=101 and getplayerhealth(players[i])<=145) then 							playerdamage(players[i],getplayerhealth(players[i])*0.55) 						elseif (getplayerhealth(players[i])>=146 and getplayerhealth(players[i])<=200) then 							playerdamage(players[i],getplayerhealth(players[i])*0.45) 						elseif (getplayerhealth(players[i])>=201 and getplayerhealth(players[i])<=260) then 							playerdamage(players[i],getplayerhealth(players[i])*0.35) 						elseif (getplayerhealth(players[i])>=261 and getplayerhealth(players[i])<=320) then 							playerdamage(players[i],getplayerhealth(players[i])*0.25) 						elseif (getplayerhealth(players[i])>=321 and getplayerhealth(players[i])<=400) then 							playerdamage(players[i],getplayerhealth(players[i])*0.15) 						elseif (getplayerhealth(players[i])>=401) then 							playerdamage(players[i],getplayerhealth(players[i])*0.05) 						end 						particle(p_ring,getplayerx(0)+getplayerdirection(0)*18,getplayery(0)+5) 						particlecolor(195,195,195) 						for j=1,24 do 							particle(p_bigblood,getplayerx(players[i])+math.random(-3,3),getplayery(players[i])+math.random(-5,7)) 							particlespeed(getplayerdirection(0)*math.random(7,10),math.random(-4,-2)) 						end 						for j=1,17 do 							particle(p_blood,getplayerx(players[i])+math.random(-3,3),getplayery(players[i])+math.random(-5,7)) 							particlespeed(getplayerdirection(0)*math.random(7,10),math.random(-4,-2)) 						end 						for j=1,7 do 							particle(p_blood,getplayerx(players[i]),getplayery(players[i])) 							particlespeed(math.random(-1.0,1.0),math.random(-4.0,-2.5)) 						end 						for j=1,10 do 							particle(p_bigblood,getplayerx(players[i]),getplayery(players[i])) 							particlespeed(math.random(-1.0,1.0),math.random(-4.0,-2.5)) 						end 					end 				end 			end 			-- End turn 			endturn() 		end 	end end