author | sheepluva |
Wed, 20 Jul 2011 00:09:13 +0200 | |
changeset 5423 | 48b7823ec7e4 |
parent 5357 | ec36f3d53f3c |
child 5490 | 18c6049b5ae3 |
permissions | -rw-r--r-- |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
4976 | 3 |
* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com> |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
4 |
* |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
8 |
* |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
13 |
* |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
17 |
*) |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
18 |
|
2599 | 19 |
{$INCLUDE "options.inc"} |
2587
0dfa56a8513c
fix a segfault in the iphone simulator by moving options.inc at the beginning of the file
koda
parents:
2428
diff
changeset
|
20 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
21 |
unit uVisualGears; |
5121
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
22 |
(* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
23 |
* This unit defines the behavior and the appearance of visual gears. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
24 |
* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
25 |
* Visual gears are "things"/"objects" in the game that do not need to be |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
26 |
* perfectly synchronized over all clients since their effect is only |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
27 |
* of visual nature. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
28 |
* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
29 |
* E.g.: background flakes, visual effects: explosion, smoke trails, etc. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
30 |
*) |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
31 |
interface |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
32 |
uses uConsts, uFloat, GLunit, uTypes; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
33 |
|
3038 | 34 |
procedure initModule; |
35 |
procedure freeModule; |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
36 |
|
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
37 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
38 |
procedure ProcessVisualGears(Steps: Longword); |
3083
8da8f2515221
Eliminate flake kick on themes with no flakes, more than 200 flakes (city) or explosions of 25 or smaller
nemo
parents:
3080
diff
changeset
|
39 |
procedure KickFlakes(Radius, X, Y: LongInt); |
1045 | 40 |
procedure DrawVisualGears(Layer: LongWord); |
1041 | 41 |
procedure DeleteVisualGear(Gear: PVisualGear); |
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
42 |
function VisualGearByUID(uid : Longword) : PVisualGear; |
803 | 43 |
procedure AddClouds; |
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
44 |
procedure ChangeToSDClouds; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
45 |
procedure AddFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
46 |
procedure ChangeToSDFlakes; |
1505 | 47 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
48 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
49 |
implementation |
4390
f219628ed666
Move localization data to uVariables, some Uses cleanup
unc0rr
parents:
4380
diff
changeset
|
50 |
uses uSound, uMobile, uVariables, uTextures, uRender, Math, uRenderUtils; |
4368 | 51 |
|
1047 | 52 |
const cExplFrameTicks = 110; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
53 |
|
5121
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
54 |
// For better maintainability the step handlers of visual gears are stored |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
5065
diff
changeset
|
55 |
// in a separate file. |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
56 |
{$INCLUDE "VGSHandlers.inc"} |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
57 |
|
1505 | 58 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
59 |
var s: shortstring; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
60 |
Gear: PVisualGear; |
1505 | 61 |
begin |
62 |
if cAltDamage then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
63 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
64 |
Gear:= AddVisualGear(X, Y, vgtSmallDamageTag); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
65 |
if Gear <> nil then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
66 |
with Gear^ do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
67 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
68 |
str(Damage, s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
69 |
Tex:= RenderStringTex(s, Color, fntSmall); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
70 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
71 |
end |
1505 | 72 |
end; |
73 |
||
74 |
||
803 | 75 |
// ================================================================== |
2042
905c554d62e6
Move Speech to visual gears. This checkin CRASHES on deletion of visual gear outside the doStep
nemo
parents:
2014
diff
changeset
|
76 |
|
803 | 77 |
// ================================================================== |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
78 |
const doStepHandlers: array[TVisualGearType] of TVGearStepProcedure = |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
79 |
( |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
80 |
@doStepFlake, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
81 |
@doStepCloud, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
82 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
83 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
84 |
@doStepFire, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
85 |
@doStepSmallDamage, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
86 |
@doStepTeamHealthSorter, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
87 |
@doStepSpeechBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
88 |
@doStepBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
89 |
@doStepSteam, |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
90 |
@doStepAmmo, |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
91 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
92 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
93 |
@doStepHealth, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
94 |
@doStepShell, |
2974 | 95 |
@doStepDust, |
2982 | 96 |
@doStepSplash, |
3032 | 97 |
@doStepDroplet, |
3080 | 98 |
@doStepSmokeRing, |
3115 | 99 |
@doStepBeeTrace, |
3145 | 100 |
@doStepEgg, |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
101 |
@doStepFeather, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
102 |
@doStepHealthTag, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
103 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
104 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
105 |
@doStepExplosion, |
3689 | 106 |
@doStepBigExplosion, |
3704 | 107 |
@doStepChunk, |
4279 | 108 |
@doStepNote, |
4327 | 109 |
@doStepLineTrail, |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
110 |
@doStepBulletHit, |
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
111 |
@doStepCircle, |
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
112 |
@doStepSmoothWindBar |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
113 |
); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
114 |
|
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
115 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear; |
4422 | 116 |
const VGCounter: Longword = 0; |
2695 | 117 |
var gear: PVisualGear; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
118 |
t: Longword; |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
119 |
sp: real; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
120 |
begin |
2671
7e0f88013fe8
smaller patches, one missing Sky-lowres, IMG_Init and Mix_Init (might require newer libraries), updates to SDL bindings, code cleanup, new compile flags
koda
parents:
2599
diff
changeset
|
121 |
if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then // we are scrolling now |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
122 |
if (Kind <> vgtCloud) and not Critical then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
123 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
124 |
AddVisualGear:= nil; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
125 |
exit |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
126 |
end; |
1642 | 127 |
|
4809
9c7d5f802618
rearrange quality flags a little, disable snow rendering on rqLowRes
koda
parents:
4806
diff
changeset
|
128 |
if ((cReducedQuality and rqAntiBoom) <> 0) and |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4390
diff
changeset
|
129 |
not Critical and |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
130 |
not (Kind in |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
131 |
[vgtTeamHealthSorter, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
132 |
vgtSmallDamageTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
133 |
vgtSpeechBubble, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
134 |
vgtHealthTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
135 |
vgtExplosion, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
136 |
vgtSmokeTrace, |
3704 | 137 |
vgtEvilTrace, |
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
138 |
vgtNote, |
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
139 |
vgtSmoothWindBar]) then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
140 |
begin |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3593
diff
changeset
|
141 |
AddVisualGear:= nil; |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3593
diff
changeset
|
142 |
exit |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
143 |
end; |
1812 | 144 |
|
4422 | 145 |
inc(VGCounter); |
2695 | 146 |
New(gear); |
147 |
FillChar(gear^, sizeof(TVisualGear), 0); |
|
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
148 |
gear^.X:= real(X); |
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
149 |
gear^.Y:= real(Y); |
2695 | 150 |
gear^.Kind := Kind; |
151 |
gear^.doStep:= doStepHandlers[Kind]; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
152 |
gear^.State:= 0; |
3475 | 153 |
gear^.Tint:= $FFFFFFFF; |
4422 | 154 |
gear^.uid:= VGCounter; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
155 |
|
2695 | 156 |
with gear^ do |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
157 |
case Kind of |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
158 |
vgtFlake: begin |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
159 |
Timer:= 0; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
160 |
tdX:= 0; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
161 |
tdY:= 0; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
162 |
if SuddenDeathDmg then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
163 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
164 |
FrameTicks:= random(vobSDFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
165 |
Frame:= random(vobSDFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
166 |
end |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
167 |
else |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
168 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
169 |
FrameTicks:= random(vobFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
170 |
Frame:= random(vobFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
171 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
172 |
Angle:= random * 360; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
173 |
dx:= 0.0000038654705 * random(10000); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
174 |
dy:= 0.000003506096 * random(7000); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
175 |
if random(2) = 0 then dx := -dx; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
176 |
if SuddenDeathDmg then dAngle:= (random(2) * 2 - 1) * (1 + random) * vobSDVelocity / 1000 |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
177 |
else dAngle:= (random(2) * 2 - 1) * (1 + random) * vobVelocity / 1000 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
178 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
179 |
vgtCloud: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
180 |
Frame:= random(4); |
3994
486da687d76a
fix/tweak let clouds reflect wind speed and direction again + stronger
sheepluva
parents:
3976
diff
changeset
|
181 |
dx:= 0.5 + 0.1 * random(5); // how much the cloud will be affected by wind |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
182 |
timer:= random(4096); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
183 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
184 |
vgtExplPart, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
185 |
vgtExplPart2: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
186 |
t:= random(1024); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
187 |
sp:= 0.001 * (random(95) + 70); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
188 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
189 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
190 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
191 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
192 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
193 |
FrameTicks:= cExplFrameTicks |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
194 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
195 |
vgtFire: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
196 |
t:= random(1024); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
197 |
sp:= 0.001 * (random(85) + 95); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
198 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
199 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
200 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
201 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
202 |
FrameTicks:= 650 + random(250); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
203 |
Frame:= random(8) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
204 |
end; |
3115 | 205 |
vgtEgg: begin |
206 |
t:= random(1024); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
207 |
sp:= 0.001 * (random(85) + 95); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
208 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
209 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
210 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
211 |
if random(2) = 0 then dy := -dy; |
3115 | 212 |
FrameTicks:= 650 + random(250); |
213 |
Frame:= 1 |
|
214 |
end; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
215 |
vgtShell: FrameTicks:= 500; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
216 |
vgtSmallDamageTag: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
217 |
gear^.FrameTicks:= 1100 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
218 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
219 |
vgtBubble: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
220 |
dx:= 0.0000038654705 * random(10000); |
3909
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3836
diff
changeset
|
221 |
dy:= 0; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
222 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
223 |
FrameTicks:= 250 + random(1751); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
224 |
Frame:= random(5) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
225 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
226 |
vgtSteam: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
227 |
dx:= 0.0000038654705 * random(10000); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
228 |
dy:= 0.001 * (random(85) + 95); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
229 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
230 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
231 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
232 |
end; |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
233 |
vgtAmmo: begin |
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
234 |
alpha:= 1.0; |
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
235 |
scale:= 1.0 |
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
236 |
end; |
3697 | 237 |
vgtSmokeWhite, |
2713 | 238 |
vgtSmoke: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
239 |
dx:= 0.0002 * (random(45) + 10); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
240 |
dy:= 0.0002 * (random(45) + 10); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
241 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
242 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
243 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
244 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
245 |
vgtHealth: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
246 |
dx:= 0.001 * random(45); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
247 |
dy:= 0.001 * (random(20) + 25); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
248 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
249 |
Frame:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
250 |
FrameTicks:= random(750) + 1250; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
251 |
end; |
2848 | 252 |
vgtDust: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
253 |
dx:= 0.005 * (random(15) + 10); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
254 |
dy:= 0.001 * (random(40) + 20); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
255 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
256 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
257 |
FrameTicks:= random(20) + 15; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
258 |
end; |
2974 | 259 |
vgtSplash: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
260 |
dx:= 0; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
261 |
dy:= 0; |
2974 | 262 |
FrameTicks:= 740; |
263 |
Frame:= 19; |
|
264 |
end; |
|
2982 | 265 |
vgtDroplet: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
266 |
dx:= 0.001 * (random(75) + 15); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
267 |
dy:= -0.001 * (random(80) + 120); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
268 |
if random(2) = 0 then dx := -dx; |
2982 | 269 |
FrameTicks:= 250 + random(1751); |
270 |
Frame:= random(3) |
|
271 |
end; |
|
3080 | 272 |
vgtBeeTrace: begin |
273 |
FrameTicks:= 1000; |
|
274 |
Frame:= random(16); |
|
275 |
end; |
|
3032 | 276 |
vgtSmokeRing: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
277 |
dx:= 0; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
278 |
dy:= 0; |
3032 | 279 |
FrameTicks:= 600; |
280 |
Timer:= 0; |
|
281 |
Frame:= 0; |
|
282 |
scale:= 0.6; |
|
283 |
alpha:= 1; |
|
284 |
angle:= random(360); |
|
285 |
end; |
|
3145 | 286 |
vgtFeather: begin |
287 |
t:= random(1024); |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
288 |
sp:= 0.001 * (random(85) + 95); |
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
289 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
290 |
dy:= hwFloat2Float(AngleCos(t)) * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
291 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
292 |
if random(2) = 0 then dy := -dy; |
3145 | 293 |
FrameTicks:= 650 + random(250); |
294 |
Frame:= 1 |
|
295 |
end; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
296 |
vgtHealthTag: begin |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
297 |
gear^.Timer:= 1500; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
298 |
//gear^.Z:= 2002; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
299 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
300 |
vgtSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
301 |
vgtEvilTrace: begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
302 |
gear^.X:= gear^.X - 16; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
303 |
gear^.Y:= gear^.Y - 16; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
304 |
gear^.State:= 8; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
305 |
//gear^.Z:= cSmokeZ |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
306 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
307 |
vgtBigExplosion: begin |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
308 |
gear^.Angle:= random(360); |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
309 |
end; |
3689 | 310 |
vgtChunk: begin |
311 |
gear^.Frame:= random(4); |
|
312 |
t:= random(1024); |
|
313 |
sp:= 0.001 * (random(85) + 47); |
|
5151
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
314 |
dx:= hwFloat2Float(AngleSin(t)) * sp; |
cbadb9fa52fc
An experiment - make bazooka AI use float instead of hwFloat - should be as accurate, but faster.
nemo
parents:
5121
diff
changeset
|
315 |
dy:= hwFloat2Float(AngleCos(t)) * sp * -2; |
3689 | 316 |
if random(2) = 0 then dx := -dx; |
317 |
end; |
|
3704 | 318 |
vgtNote: begin |
319 |
dx:= 0.005 * (random(15) + 10); |
|
3706 | 320 |
dy:= -0.001 * (random(40) + 20); |
3704 | 321 |
if random(2) = 0 then dx := -dx; |
322 |
Frame:= random(4); |
|
323 |
FrameTicks:= random(2000) + 1500; |
|
324 |
end; |
|
4327 | 325 |
vgtBulletHit: begin |
326 |
dx:= 0; |
|
327 |
dy:= 0; |
|
328 |
FrameTicks:= 350; |
|
329 |
Frame:= 7; |
|
330 |
Angle := 0; |
|
331 |
end; |
|
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5256
diff
changeset
|
332 |
vgtSmoothWindBar: Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
333 |
end; |
803 | 334 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
335 |
if State <> 0 then gear^.State:= State; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
336 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
337 |
if VisualGearsList <> nil then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
338 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
339 |
VisualGearsList^.PrevGear:= gear; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
340 |
gear^.NextGear:= VisualGearsList |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
341 |
end; |
2695 | 342 |
VisualGearsList:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
343 |
|
2695 | 344 |
AddVisualGear:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
345 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
346 |
|
1041 | 347 |
procedure DeleteVisualGear(Gear: PVisualGear); |
348 |
begin |
|
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
349 |
if Gear^.Tex <> nil then |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
350 |
FreeTexture(Gear^.Tex); |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
351 |
Gear^.Tex:= nil; |
1505 | 352 |
|
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
353 |
if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear; |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
354 |
if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
355 |
else VisualGearsList:= Gear^.NextGear; |
1041 | 356 |
|
4780
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
357 |
if lastVisualGearByUID = Gear then lastVisualGearByUID:= nil; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
358 |
|
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3475
diff
changeset
|
359 |
Dispose(Gear); |
1041 | 360 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
361 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
362 |
procedure ProcessVisualGears(Steps: Longword); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
363 |
var Gear, t: PVisualGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
364 |
begin |
803 | 365 |
if Steps = 0 then exit; |
366 |
||
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
367 |
t:= VisualGearsList; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
368 |
while t <> nil do |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
369 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
370 |
Gear:= t; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
371 |
t:= Gear^.NextGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
372 |
Gear^.doStep(Gear, Steps) |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
373 |
end |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
374 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
375 |
|
3083
8da8f2515221
Eliminate flake kick on themes with no flakes, more than 200 flakes (city) or explosions of 25 or smaller
nemo
parents:
3080
diff
changeset
|
376 |
procedure KickFlakes(Radius, X, Y: LongInt); |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
377 |
var Gear, t: PVisualGear; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
378 |
dmg: LongInt; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
379 |
begin |
3641 | 380 |
if (vobCount = 0) or (vobCount > 200) then exit; |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
381 |
t:= VisualGearsList; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
382 |
while t <> nil do |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
383 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
384 |
Gear:= t; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
385 |
if Gear^.Kind = vgtFlake then |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
386 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
387 |
// Damage calc from doMakeExplosion |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
388 |
dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
389 |
if dmg > 1 then |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
390 |
begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
391 |
Gear^.tdX:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
392 |
if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
393 |
Gear^.tdY:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
394 |
if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; |
2986 | 395 |
Gear^.Timer:= 200 |
2985
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
396 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
397 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
398 |
t:= Gear^.NextGear |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
399 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
400 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
401 |
|
1045 | 402 |
procedure DrawVisualGears(Layer: LongWord); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
403 |
var Gear: PVisualGear; |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
404 |
tinted: boolean; |
4545 | 405 |
tmp: real; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
406 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
407 |
Gear:= VisualGearsList; |
1045 | 408 |
case Layer of |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
409 |
// this layer is very distant in the background when stereo |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
410 |
0: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
411 |
begin |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
412 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
413 |
case Gear^.Kind of |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
414 |
vgtFlake: if SuddenDeathDmg then |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
415 |
if vobSDVelocity = 0 then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
416 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
417 |
else |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
418 |
DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
3641 | 419 |
else |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
420 |
if vobVelocity = 0 then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
421 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
422 |
else |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
423 |
DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
4772
02370ca8e92c
sudden death: now having theme support, still some work though with config
Henek
parents:
4748
diff
changeset
|
424 |
vgtCloud: if SuddenDeathDmg then |
02370ca8e92c
sudden death: now having theme support, still some work though with config
Henek
parents:
4748
diff
changeset
|
425 |
DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
02370ca8e92c
sudden death: now having theme support, still some work though with config
Henek
parents:
4748
diff
changeset
|
426 |
else |
02370ca8e92c
sudden death: now having theme support, still some work though with config
Henek
parents:
4748
diff
changeset
|
427 |
DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
428 |
end; |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
429 |
if Gear^.Tint <> $FFFFFFFF then Tint($FF,$FF,$FF,$FF); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
430 |
Gear:= Gear^.NextGear |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
431 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
432 |
// this layer is on the land level (which is close but behind the screen plane) when stereo |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
433 |
1: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
434 |
begin |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
435 |
tinted:= false; |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
436 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
437 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
438 |
vgtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
439 |
vgtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
4279 | 440 |
vgtLineTrail: DrawLine(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 1.0, $FF, min(Gear^.Timer, $C0), min(Gear^.Timer, $80), min(Gear^.Timer, $FF)); |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
441 |
end; |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
442 |
if (cReducedQuality and rqAntiBoom) = 0 then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
443 |
case Gear^.Kind of |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
444 |
vgtSmoke: DrawSprite(sprSmoke, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
445 |
vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
446 |
vgtDust: if Gear^.State = 1 then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
447 |
DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
448 |
else |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
449 |
DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
450 |
vgtFire: if (Gear^.State and gstTmpFlag) = 0 then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
451 |
DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
452 |
else |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
453 |
DrawTextureF(SpritesData[sprFlame].Texture, Gear^.FrameTicks / 900, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, (RealTicks shr 7 + Gear^.Frame) mod 8, 1, 16, 16); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
454 |
vgtSplash: if SuddenDeathDmg then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
455 |
DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
456 |
else |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
457 |
DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
458 |
vgtDroplet: if SuddenDeathDmg then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
459 |
DrawSprite(sprSDDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
460 |
else |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
461 |
DrawSprite(sprDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
462 |
vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
463 |
end; |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
464 |
if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
465 |
Gear:= Gear^.NextGear |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
466 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
467 |
// this layer is on the screen plane (depth = 0) when stereo |
4818
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
468 |
3: while Gear <> nil do |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
469 |
begin |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
470 |
tinted:= false; |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
471 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
472 |
case Gear^.Kind of |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
473 |
vgtSpeechBubble: begin |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
474 |
if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
475 |
begin |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
476 |
tinted:= true; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
477 |
Tint($FF, $FF, $FF, $66); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
478 |
DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
479 |
end |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
480 |
else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
481 |
DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
482 |
end; |
4818
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
483 |
vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
484 |
vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
485 |
vgtHealth: begin |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
486 |
tinted:= true; |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
487 |
case Gear^.Frame div 10 of |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
488 |
0:Tint(0, $FF, 0, round(Gear^.FrameTicks * $FF / 1000)); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
489 |
1:Tint($FF, 0, 0, round(Gear^.FrameTicks * $FF / 1000)); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
490 |
end; |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
491 |
DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
492 |
end; |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
493 |
end; |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
494 |
if (cReducedQuality and rqAntiBoom) = 0 then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
495 |
case Gear^.Kind of |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
496 |
vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
497 |
end; |
4818
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
498 |
if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
499 |
Gear:= Gear^.NextGear |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
500 |
end; |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
501 |
// this layer is outside the screen when stereo |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
502 |
2: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
503 |
begin |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
504 |
tinted:= false; |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
505 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
506 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
507 |
vgtExplosion: DrawSprite(sprExplosion50, round(Gear^.X) - 32 + WorldDx, round(Gear^.Y) - 32 + WorldDy, Gear^.State); |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
508 |
vgtBigExplosion: begin |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
509 |
tinted:= true; |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4378
diff
changeset
|
510 |
Tint($FF, $FF, $FF, round($FF * (1 - power(Gear^.Timer / 250, 4)))); |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
511 |
DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle); |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
512 |
end; |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
513 |
end; |
4809
9c7d5f802618
rearrange quality flags a little, disable snow rendering on rqLowRes
koda
parents:
4806
diff
changeset
|
514 |
if (cReducedQuality and rqAntiBoom) = 0 then |
2047
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
515 |
case Gear^.Kind of |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
516 |
vgtExplPart: DrawSprite(sprExplPart, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
517 |
vgtExplPart2: DrawSprite(sprExplPart2, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame); |
3754 | 518 |
vgtSteam: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
519 |
vgtAmmo: begin |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
520 |
tinted:= true; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
521 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
522 |
DrawTextureF(ropeIconTex, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 32, 32); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
523 |
DrawTextureF(SpritesData[sprAMAmmos].Texture, Gear^.scale * 0.90, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame - 1, 1, 32, 32); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
524 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
525 |
vgtShell: begin |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
526 |
if Gear^.FrameTicks < $FF then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
527 |
begin |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
528 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
529 |
tinted:= true |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
530 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
531 |
DrawRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
532 |
end; |
4818
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
533 |
vgtFeather: begin |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
534 |
if Gear^.FrameTicks < 255 then |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
535 |
begin |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
536 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
537 |
tinted:= true |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
538 |
end; |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
539 |
DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
540 |
end; |
202eef454354
rename "frame alternate" to "wiggle" as it's more appropriate
koda
parents:
4809
diff
changeset
|
541 |
vgtEgg: begin |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
542 |
if Gear^.FrameTicks < $FF then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
543 |
begin |
3376 | 544 |
Tint($FF, $FF, $FF, Gear^.FrameTicks); |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
545 |
tinted:= true |
3115 | 546 |
end; |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
547 |
DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
548 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
549 |
vgtBeeTrace: begin |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
550 |
if Gear^.FrameTicks < $FF then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
551 |
Tint($FF, $FF, $FF, Gear^.FrameTicks div 2) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
552 |
else |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
553 |
Tint($FF, $FF, $FF, $80); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
554 |
tinted:= true; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
555 |
DrawRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
556 |
end; |
3032 | 557 |
vgtSmokeRing: begin |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
558 |
tinted:= true; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
559 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
560 |
DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle); |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
561 |
end; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
562 |
vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
4327 | 563 |
vgtBulletHit: DrawRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle); |
2047
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
564 |
end; |
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
565 |
case Gear^.Kind of |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
566 |
vgtCircle: if gear^.Angle = 1 then |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
567 |
begin |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
568 |
tmp:= Gear^.State / 100; |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
569 |
DrawTexture(round(Gear^.X-24*tmp) + WorldDx, round(Gear^.Y-24*tmp) + WorldDy, SpritesData[sprVampiric].Texture, tmp) |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
570 |
end |
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
571 |
else DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer); |
2047
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
572 |
end; |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4465
diff
changeset
|
573 |
if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
574 |
Gear:= Gear^.NextGear |
5256
e3fada9358b0
fix water bubbles like sheepluva wanted (also code formatting)
koda
parents:
5179
diff
changeset
|
575 |
end |
4452 | 576 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
577 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
578 |
|
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
579 |
function VisualGearByUID(uid : Longword) : PVisualGear; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
580 |
var vg: PVisualGear; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
581 |
begin |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
582 |
VisualGearByUID:= nil; |
4780
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
583 |
if uid = 0 then exit; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
584 |
if (lastVisualGearByUID <> nil) and (lastVisualGearByUID^.uid = uid) then |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
585 |
begin |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
586 |
VisualGearByUID:= lastVisualGearByUID; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
587 |
exit |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
588 |
end; |
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
589 |
vg:= VisualGearsList; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
590 |
while vg <> nil do |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
591 |
begin |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
592 |
if vg^.uid = uid then |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
593 |
begin |
4780
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
594 |
lastVisualGearByUID:= vg; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
595 |
VisualGearByUID:= vg; |
8571151411b3
add a couple of variables to speed up UID lookups. Based on the assumption new visual gears and gears will tend to be at the end of the list. Set them on successful lookup or script gear creation, clear on delete. Oh also pick up a couple of TrevInc's translation changes
nemo
parents:
4772
diff
changeset
|
596 |
exit |
4443
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
597 |
end; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
598 |
vg:= vg^.NextGear |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
599 |
end |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
600 |
end; |
d393b9ccd328
Add an extra pass in FindPlace for AI resurrection mode to try to make it unwinnable, add DeleteGear, DeleteVisualGear, AddVisualGear, GetVisualGearValues, SetVisualGearValues to Lua
nemo
parents:
4422
diff
changeset
|
601 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
602 |
procedure AddClouds; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
603 |
var i: LongInt; |
803 | 604 |
begin |
1132 | 605 |
for i:= 0 to cCloudsNumber - 1 do |
5179
8d64dcb566ea
Fix "Mixing signed expressions and longwords gives a 64bit result" warnings
unc0rr
parents:
5151
diff
changeset
|
606 |
AddVisualGear(cLeftScreenBorder + i * LongInt(cScreenSpace div (cCloudsNumber + 1)), LAND_HEIGHT-1184, vgtCloud) |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
607 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
608 |
|
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
609 |
procedure ChangeToSDClouds; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
610 |
var i: LongInt; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
611 |
vg, tmp: PVisualGear; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
612 |
begin |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
613 |
if cCloudsNumber = cSDCloudsNumber then exit; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
614 |
vg:= VisualGearsList; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
615 |
while vg <> nil do |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
616 |
if vg^.Kind = vgtCloud then |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
617 |
begin |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
618 |
tmp:= vg^.NextGear; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
619 |
DeleteVisualGear(vg); |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
620 |
vg:= tmp |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
621 |
end |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
622 |
else vg:= vg^.NextGear; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
623 |
for i:= 0 to cSDCloudsNumber - 1 do |
5179
8d64dcb566ea
Fix "Mixing signed expressions and longwords gives a 64bit result" warnings
unc0rr
parents:
5151
diff
changeset
|
624 |
AddVisualGear(cLeftScreenBorder + i * LongInt(cScreenSpace div (cSDCloudsNumber + 1)), LAND_HEIGHT-1184, vgtCloud) |
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
625 |
end; |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4782
diff
changeset
|
626 |
|
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
627 |
procedure AddFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
628 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
629 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
630 |
if (cReducedQuality and rqKillFlakes) <> 0 then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
631 |
|
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
632 |
if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
5014 | 633 |
for i:= 0 to Pred(vobCount * cScreenSpace div LAND_WIDTH) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
634 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake) |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
635 |
else |
5014 | 636 |
for i:= 0 to Pred((vobCount * cScreenSpace div LAND_WIDTH) div 3) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
637 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
638 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
639 |
|
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
640 |
procedure ChangeToSDFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
641 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
642 |
vg, tmp: PVisualGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
643 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
644 |
if (cReducedQuality and rqKillFlakes) <> 0 then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
645 |
if vobCount = vobSDCount then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
646 |
vg:= VisualGearsList; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
647 |
while vg <> nil do |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
648 |
if vg^.Kind = vgtFlake then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
649 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
650 |
tmp:= vg^.NextGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
651 |
DeleteVisualGear(vg); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
652 |
vg:= tmp |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
653 |
end |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
654 |
else vg:= vg^.NextGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
655 |
if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
5014 | 656 |
for i:= 0 to Pred(vobSDCount * cScreenSpace div LAND_WIDTH) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
657 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake) |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
658 |
else |
5014 | 659 |
for i:= 0 to Pred((vobSDCount * cScreenSpace div LAND_WIDTH) div 3) do |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
660 |
AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
661 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
662 |
|
3038 | 663 |
procedure initModule; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
664 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
665 |
VisualGearsList:= nil; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
666 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
667 |
|
3038 | 668 |
procedure freeModule; |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
669 |
begin |
3615 | 670 |
while VisualGearsList <> nil do DeleteVisualGear(VisualGearsList); |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
671 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
672 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
673 |
end. |