author | koda |
Sun, 02 Jan 2011 19:30:16 +0100 | |
changeset 4809 | 9c7d5f802618 |
parent 4806 | 48c1a395f0a7 |
child 4818 | 202eef454354 |
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 |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
3 |
* Copyright (c) 2008 Andrey Korotaev <unC0Rr@gmail.com> |
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; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
22 |
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
|
23 |
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
|
24 |
|
3038 | 25 |
procedure initModule; |
26 |
procedure freeModule; |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
27 |
|
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
|
28 |
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
|
29 |
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
|
30 |
procedure KickFlakes(Radius, X, Y: LongInt); |
1045 | 31 |
procedure DrawVisualGears(Layer: LongWord); |
1041 | 32 |
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
|
33 |
function VisualGearByUID(uid : Longword) : PVisualGear; |
803 | 34 |
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
|
35 |
procedure ChangeToSDClouds; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
36 |
procedure AddFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
37 |
procedure ChangeToSDFlakes; |
1505 | 38 |
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
|
39 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
40 |
implementation |
4390
f219628ed666
Move localization data to uVariables, some Uses cleanup
unc0rr
parents:
4380
diff
changeset
|
41 |
uses uSound, uMobile, uVariables, uTextures, uRender, Math, uRenderUtils; |
4368 | 42 |
|
1047 | 43 |
const cExplFrameTicks = 110; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
44 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
45 |
{$INCLUDE "VGSHandlers.inc"} |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
46 |
|
1505 | 47 |
procedure AddDamageTag(X, Y, Damage, Color: LongWord); |
48 |
var s: shortstring; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
49 |
Gear: PVisualGear; |
1505 | 50 |
begin |
51 |
if cAltDamage then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
52 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
53 |
Gear:= AddVisualGear(X, Y, vgtSmallDamageTag); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
54 |
if Gear <> nil then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
55 |
with Gear^ do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
56 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
57 |
str(Damage, s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
58 |
Tex:= RenderStringTex(s, Color, fntSmall); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
59 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
60 |
end |
1505 | 61 |
end; |
62 |
||
63 |
||
803 | 64 |
// ================================================================== |
2042
905c554d62e6
Move Speech to visual gears. This checkin CRASHES on deletion of visual gear outside the doStep
nemo
parents:
2014
diff
changeset
|
65 |
|
803 | 66 |
// ================================================================== |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
67 |
const doStepHandlers: array[TVisualGearType] of TVGearStepProcedure = |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
68 |
( |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
69 |
@doStepFlake, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
70 |
@doStepCloud, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
71 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
72 |
@doStepExpl, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
73 |
@doStepFire, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
74 |
@doStepSmallDamage, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
75 |
@doStepTeamHealthSorter, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
76 |
@doStepSpeechBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
77 |
@doStepBubble, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
78 |
@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
|
79 |
@doStepAmmo, |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
80 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
81 |
@doStepSmoke, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
82 |
@doStepHealth, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
83 |
@doStepShell, |
2974 | 84 |
@doStepDust, |
2982 | 85 |
@doStepSplash, |
3032 | 86 |
@doStepDroplet, |
3080 | 87 |
@doStepSmokeRing, |
3115 | 88 |
@doStepBeeTrace, |
3145 | 89 |
@doStepEgg, |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
90 |
@doStepFeather, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
91 |
@doStepHealthTag, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
92 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
93 |
@doStepSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
94 |
@doStepExplosion, |
3689 | 95 |
@doStepBigExplosion, |
3704 | 96 |
@doStepChunk, |
4279 | 97 |
@doStepNote, |
4327 | 98 |
@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
|
99 |
@doStepBulletHit, |
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
|
100 |
@doStepCircle |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
101 |
); |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
102 |
|
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
|
103 |
function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear; |
4422 | 104 |
const VGCounter: Longword = 0; |
2695 | 105 |
var gear: PVisualGear; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
106 |
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
|
107 |
sp: real; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
108 |
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
|
109 |
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
|
110 |
if (Kind <> vgtCloud) and not Critical then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
111 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
112 |
AddVisualGear:= nil; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
113 |
exit |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
114 |
end; |
1642 | 115 |
|
4809
9c7d5f802618
rearrange quality flags a little, disable snow rendering on rqLowRes
koda
parents:
4806
diff
changeset
|
116 |
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
|
117 |
not Critical and |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
118 |
not (Kind in |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
119 |
[vgtTeamHealthSorter, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
120 |
vgtSmallDamageTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
121 |
vgtSpeechBubble, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
122 |
vgtHealthTag, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
123 |
vgtExplosion, |
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
124 |
vgtSmokeTrace, |
3704 | 125 |
vgtEvilTrace, |
126 |
vgtNote]) then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
127 |
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
|
128 |
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
|
129 |
exit |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
130 |
end; |
1812 | 131 |
|
4422 | 132 |
inc(VGCounter); |
2695 | 133 |
New(gear); |
134 |
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
|
135 |
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
|
136 |
gear^.Y:= real(Y); |
2695 | 137 |
gear^.Kind := Kind; |
138 |
gear^.doStep:= doStepHandlers[Kind]; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
139 |
gear^.State:= 0; |
3475 | 140 |
gear^.Tint:= $FFFFFFFF; |
4422 | 141 |
gear^.uid:= VGCounter; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
142 |
|
2695 | 143 |
with gear^ do |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
144 |
case Kind of |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
145 |
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
|
146 |
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
|
147 |
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
|
148 |
tdY:= 0; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
149 |
if SuddenDeathDmg then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
150 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
151 |
FrameTicks:= random(vobSDFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
152 |
Frame:= random(vobSDFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
153 |
end |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
154 |
else |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
155 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
156 |
FrameTicks:= random(vobFrameTicks); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
157 |
Frame:= random(vobFramesCount); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
158 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
159 |
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
|
160 |
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
|
161 |
dy:= 0.000003506096 * random(7000); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
162 |
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
|
163 |
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
|
164 |
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
|
165 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
166 |
vgtCloud: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
167 |
Frame:= random(4); |
3994
486da687d76a
fix/tweak let clouds reflect wind speed and direction again + stronger
sheepluva
parents:
3976
diff
changeset
|
168 |
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
|
169 |
timer:= random(4096); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
170 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
171 |
vgtExplPart, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
172 |
vgtExplPart2: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
173 |
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
|
174 |
sp:= 0.001 * (random(95) + 70); |
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
|
175 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
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
|
176 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
177 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
178 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
179 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
180 |
FrameTicks:= cExplFrameTicks |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
181 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
182 |
vgtFire: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
183 |
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
|
184 |
sp:= 0.001 * (random(85) + 95); |
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
|
185 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
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
|
186 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
187 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
188 |
if random(2) = 0 then dy := -dy; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
189 |
FrameTicks:= 650 + random(250); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
190 |
Frame:= random(8) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
191 |
end; |
3115 | 192 |
vgtEgg: begin |
193 |
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
|
194 |
sp:= 0.001 * (random(85) + 95); |
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
|
195 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
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
|
196 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
197 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
198 |
if random(2) = 0 then dy := -dy; |
3115 | 199 |
FrameTicks:= 650 + random(250); |
200 |
Frame:= 1 |
|
201 |
end; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
202 |
vgtShell: FrameTicks:= 500; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
203 |
vgtSmallDamageTag: begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
204 |
gear^.FrameTicks:= 1100 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
205 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
206 |
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
|
207 |
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
|
208 |
dy:= 0; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
209 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
210 |
FrameTicks:= 250 + random(1751); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
211 |
Frame:= random(5) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
212 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
213 |
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
|
214 |
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
|
215 |
dy:= 0.001 * (random(85) + 95); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
216 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
217 |
Frame:= 7 - random(3); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
218 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
219 |
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
|
220 |
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
|
221 |
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
|
222 |
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
|
223 |
end; |
3697 | 224 |
vgtSmokeWhite, |
2713 | 225 |
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
|
226 |
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
|
227 |
dy:= 0.0002 * (random(45) + 10); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
228 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
229 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
230 |
FrameTicks:= cExplFrameTicks * 2; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
231 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
232 |
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
|
233 |
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
|
234 |
dy:= 0.001 * (random(20) + 25); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
235 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
236 |
Frame:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
237 |
FrameTicks:= random(750) + 1250; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
238 |
end; |
2848 | 239 |
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
|
240 |
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
|
241 |
dy:= 0.001 * (random(40) + 20); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
242 |
if random(2) = 0 then dx := -dx; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
243 |
Frame:= 7 - random(2); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
244 |
FrameTicks:= random(20) + 15; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
245 |
end; |
2974 | 246 |
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
|
247 |
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
|
248 |
dy:= 0; |
2974 | 249 |
FrameTicks:= 740; |
250 |
Frame:= 19; |
|
251 |
end; |
|
2982 | 252 |
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
|
253 |
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
|
254 |
dy:= -0.001 * (random(80) + 120); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
255 |
if random(2) = 0 then dx := -dx; |
2982 | 256 |
FrameTicks:= 250 + random(1751); |
257 |
Frame:= random(3) |
|
258 |
end; |
|
3080 | 259 |
vgtBeeTrace: begin |
260 |
FrameTicks:= 1000; |
|
261 |
Frame:= random(16); |
|
262 |
end; |
|
3032 | 263 |
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
|
264 |
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
|
265 |
dy:= 0; |
3032 | 266 |
FrameTicks:= 600; |
267 |
Timer:= 0; |
|
268 |
Frame:= 0; |
|
269 |
scale:= 0.6; |
|
270 |
alpha:= 1; |
|
271 |
angle:= random(360); |
|
272 |
end; |
|
3145 | 273 |
vgtFeather: begin |
274 |
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
|
275 |
sp:= 0.001 * (random(85) + 95); |
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
|
276 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
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 |
dy:= AngleCos(t).QWordValue/4294967296 * sp; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
278 |
if random(2) = 0 then dx := -dx; |
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
279 |
if random(2) = 0 then dy := -dy; |
3145 | 280 |
FrameTicks:= 650 + random(250); |
281 |
Frame:= 1 |
|
282 |
end; |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
283 |
vgtHealthTag: begin |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
284 |
gear^.Timer:= 1500; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
285 |
//gear^.Z:= 2002; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
286 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
287 |
vgtSmokeTrace, |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
288 |
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
|
289 |
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
|
290 |
gear^.Y:= gear^.Y - 16; |
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
291 |
gear^.State:= 8; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
292 |
//gear^.Z:= cSmokeZ |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
293 |
end; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
294 |
vgtBigExplosion: begin |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
295 |
gear^.Angle:= random(360); |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
296 |
end; |
3689 | 297 |
vgtChunk: begin |
298 |
gear^.Frame:= random(4); |
|
299 |
t:= random(1024); |
|
300 |
sp:= 0.001 * (random(85) + 47); |
|
301 |
dx:= AngleSin(t).QWordValue/4294967296 * sp; |
|
3706 | 302 |
dy:= AngleCos(t).QWordValue/4294967296 * sp * -2; |
3689 | 303 |
if random(2) = 0 then dx := -dx; |
304 |
end; |
|
3704 | 305 |
vgtNote: begin |
306 |
dx:= 0.005 * (random(15) + 10); |
|
3706 | 307 |
dy:= -0.001 * (random(40) + 20); |
3704 | 308 |
if random(2) = 0 then dx := -dx; |
309 |
Frame:= random(4); |
|
310 |
FrameTicks:= random(2000) + 1500; |
|
311 |
end; |
|
4327 | 312 |
vgtBulletHit: begin |
313 |
dx:= 0; |
|
314 |
dy:= 0; |
|
315 |
FrameTicks:= 350; |
|
316 |
Frame:= 7; |
|
317 |
Angle := 0; |
|
318 |
end; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
319 |
end; |
803 | 320 |
|
3440
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
321 |
if State <> 0 then gear^.State:= State; |
dee31c5149e0
* gtHealthTag, gtSmokeTrace, gtEvilTrace, gtExplosion and gtBigExplosion are visual gears now (vgt*)
sheepluva
parents:
3420
diff
changeset
|
322 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
323 |
if VisualGearsList <> nil then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
324 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
325 |
VisualGearsList^.PrevGear:= gear; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
326 |
gear^.NextGear:= VisualGearsList |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
327 |
end; |
2695 | 328 |
VisualGearsList:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
329 |
|
2695 | 330 |
AddVisualGear:= gear; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
331 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
332 |
|
1041 | 333 |
procedure DeleteVisualGear(Gear: PVisualGear); |
334 |
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
|
335 |
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
|
336 |
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
|
337 |
Gear^.Tex:= nil; |
1505 | 338 |
|
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
|
339 |
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
|
340 |
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
|
341 |
else VisualGearsList:= Gear^.NextGear; |
1041 | 342 |
|
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
|
343 |
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
|
344 |
|
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
|
345 |
Dispose(Gear); |
1041 | 346 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
347 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
348 |
procedure ProcessVisualGears(Steps: Longword); |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
349 |
var Gear, t: PVisualGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
350 |
begin |
803 | 351 |
if Steps = 0 then exit; |
352 |
||
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
353 |
t:= VisualGearsList; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
354 |
while t <> nil do |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
355 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
356 |
Gear:= t; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
357 |
t:= Gear^.NextGear; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
358 |
Gear^.doStep(Gear, Steps) |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
359 |
end |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
360 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
361 |
|
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
|
362 |
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
|
363 |
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
|
364 |
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
|
365 |
begin |
3641 | 366 |
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
|
367 |
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
|
368 |
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
|
369 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
370 |
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
|
371 |
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
|
372 |
begin |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
373 |
// 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
|
374 |
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
|
375 |
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
|
376 |
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
|
377 |
Gear^.tdX:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
378 |
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
|
379 |
Gear^.tdY:= 0.02 * dmg + 0.01; |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3594
diff
changeset
|
380 |
if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; |
2986 | 381 |
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
|
382 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
383 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
384 |
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
|
385 |
end |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
386 |
end; |
d268a7fbb868
Kick flakes a bit when an explosion is nearby. Needs testing / review by those more artistically inclined
nemo
parents:
2982
diff
changeset
|
387 |
|
1045 | 388 |
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
|
389 |
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
|
390 |
tinted: boolean; |
4545 | 391 |
tmp: real; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
392 |
begin |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
393 |
Gear:= VisualGearsList; |
1045 | 394 |
case Layer of |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
395 |
0: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
396 |
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
|
397 |
if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
398 |
case Gear^.Kind of |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
399 |
vgtFlake: if SuddenDeathDmg then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
400 |
if vobSDVelocity = 0 then |
4748 | 401 |
DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
402 |
else |
|
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
403 |
DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
3641 | 404 |
else |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
405 |
if vobVelocity = 0 then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
406 |
DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
4748 | 407 |
else |
408 |
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
|
409 |
vgtCloud: if SuddenDeathDmg then |
02370ca8e92c
sudden death: now having theme support, still some work though with config
Henek
parents:
4748
diff
changeset
|
410 |
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
|
411 |
else |
02370ca8e92c
sudden death: now having theme support, still some work though with config
Henek
parents:
4748
diff
changeset
|
412 |
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
|
413 |
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
|
414 |
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
|
415 |
Gear:= Gear^.NextGear |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
416 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
417 |
1: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
418 |
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
|
419 |
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
|
420 |
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
|
421 |
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
|
422 |
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
|
423 |
vgtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
4279 | 424 |
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)); |
4521
96066d42c3f9
Add override for speech bubble position 0: default, 1: background/translucent 2: foreground/opaque
nemo
parents:
4475
diff
changeset
|
425 |
vgtSpeechBubble: if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then |
4465
743673c67d0c
Allow hog speech when not your turn. Currently is set to 40% opacity (could be fainter) and drawn behind the hogs instead of in front. Also allows hog targetting using a number.
nemo
parents:
4452
diff
changeset
|
426 |
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
|
427 |
tinted:= true; |
4465
743673c67d0c
Allow hog speech when not your turn. Currently is set to 40% opacity (could be fainter) and drawn behind the hogs instead of in front. Also allows hog targetting using a number.
nemo
parents:
4452
diff
changeset
|
428 |
Tint($FF, $FF, $FF, $66); |
743673c67d0c
Allow hog speech when not your turn. Currently is set to 40% opacity (could be fainter) and drawn behind the hogs instead of in front. Also allows hog targetting using a number.
nemo
parents:
4452
diff
changeset
|
429 |
DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
743673c67d0c
Allow hog speech when not your turn. Currently is set to 40% opacity (could be fainter) and drawn behind the hogs instead of in front. Also allows hog targetting using a number.
nemo
parents:
4452
diff
changeset
|
430 |
end |
3447
2f1c2b7215e6
make some of the newly migrated visual gears visible in reduced quality mode
sheepluva
parents:
3443
diff
changeset
|
431 |
end; |
4809
9c7d5f802618
rearrange quality flags a little, disable snow rendering on rqLowRes
koda
parents:
4806
diff
changeset
|
432 |
if (cReducedQuality and rqAntiBoom) = 0 then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
433 |
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
|
434 |
vgtSmoke: DrawSprite(sprSmoke, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 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
|
435 |
vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 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
|
436 |
vgtDust: DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
3148 | 437 |
vgtFeather: begin |
3376 | 438 |
if Gear^.FrameTicks < 255 then |
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
|
439 |
begin |
3376 | 440 |
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
|
441 |
tinted:= true |
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
|
442 |
end; |
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
|
443 |
DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
3148 | 444 |
end; |
3443
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
445 |
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
|
446 |
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
|
447 |
Gear:= Gear^.NextGear |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
448 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
449 |
2: while Gear <> nil do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
450 |
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
|
451 |
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
|
452 |
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
|
453 |
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
|
454 |
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
|
455 |
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
|
456 |
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
|
457 |
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
|
458 |
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
|
459 |
end; |
14d12df0d363
finishing the gtHealthTag -> vgtHealthTag, no segfaults and hogzombies no more, hopefully
sheepluva
parents:
3440
diff
changeset
|
460 |
end; |
4809
9c7d5f802618
rearrange quality flags a little, disable snow rendering on rqLowRes
koda
parents:
4806
diff
changeset
|
461 |
if (cReducedQuality and rqAntiBoom) = 0 then |
2047
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
462 |
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
|
463 |
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
|
464 |
vgtExplPart2: DrawSprite(sprExplPart2, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame); |
3751 | 465 |
vgtFire: if (Gear^.State and gstTmpFlag) = 0 then |
466 |
DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8) |
|
467 |
else |
|
468 |
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); |
|
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
|
469 |
vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8); |
3754 | 470 |
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
|
471 |
vgtAmmo: 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
|
472 |
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
|
473 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
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
|
474 |
DrawTextureF(ropeIconTex, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 32, 32); |
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
|
475 |
DrawTextureF(SpritesData[sprAMAmmos].Texture, Gear^.scale * 0.90, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame - 1, 1, 32, 32); |
2972
82828fd23dea
Patch by soreau (polished by me): show floating away ammo icon when you pick up a crate
unc0rr
parents:
2948
diff
changeset
|
476 |
end; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
477 |
vgtHealth: 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
|
478 |
tinted:= true; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
479 |
case Gear^.Frame div 10 of |
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
|
480 |
0:Tint(0, $FF, 0, round(Gear^.FrameTicks * $FF / 1000)); |
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
|
481 |
1:Tint($FF, 0, 0, round(Gear^.FrameTicks * $FF / 1000)); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
482 |
end; |
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
|
483 |
DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
484 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
485 |
vgtShell: begin |
3376 | 486 |
if Gear^.FrameTicks < $FF then |
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
|
487 |
begin |
3376 | 488 |
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
|
489 |
tinted:= true |
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
|
490 |
end; |
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
|
491 |
DrawRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
492 |
end; |
3115 | 493 |
vgtEgg: begin |
3376 | 494 |
if Gear^.FrameTicks < $FF then |
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
|
495 |
begin |
3376 | 496 |
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
|
497 |
tinted:= true |
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
|
498 |
end; |
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
|
499 |
DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
3115 | 500 |
end; |
4782
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
501 |
vgtSplash: if SuddenDeathDmg then |
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
502 |
DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)) |
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
503 |
else |
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
504 |
DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37)); |
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
505 |
vgtDroplet: if SuddenDeathDmg then |
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
506 |
DrawSprite(sprSDDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame) |
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
507 |
else |
603916ddf4b6
added also splash and droplets to sd and refactored theme.cfg, not all themes updated
Henek
parents:
4780
diff
changeset
|
508 |
DrawSprite(sprDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame); |
3080 | 509 |
vgtBeeTrace: begin |
3376 | 510 |
if Gear^.FrameTicks < $FF then |
511 |
Tint($FF, $FF, $FF, Gear^.FrameTicks div 2) |
|
3080 | 512 |
else |
3390 | 513 |
Tint($FF, $FF, $FF, $80); |
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
|
514 |
tinted:= true; |
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
|
515 |
DrawRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle); |
3080 | 516 |
end; |
3032 | 517 |
vgtSmokeRing: 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
|
518 |
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
|
519 |
Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); |
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
|
520 |
DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle); |
3032 | 521 |
end; |
3689 | 522 |
vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
3704 | 523 |
vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); |
4327 | 524 |
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
|
525 |
end; |
805f7b62cff6
Allow speech bubble/small damage tags in "reduced quality"
nemo
parents:
2045
diff
changeset
|
526 |
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
|
527 |
vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
4521
96066d42c3f9
Add override for speech bubble position 0: default, 1: background/translucent 2: foreground/opaque
nemo
parents:
4475
diff
changeset
|
528 |
vgtSpeechBubble: if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
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
|
529 |
vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
4545 | 530 |
vgtCircle: if gear^.Angle = 1 then |
531 |
begin |
|
532 |
tmp:= Gear^.State / 100; |
|
4546
a6402b8c2b24
oops, forgot world offset, also add a kind of hack to the already hackish set function for visual gears
nemo
parents:
4545
diff
changeset
|
533 |
DrawTexture(round(Gear^.X-24*tmp) + WorldDx, round(Gear^.Y-24*tmp) + WorldDy, SpritesData[sprVampiric].Texture, tmp) |
4545 | 534 |
end |
4544
d999e3221e3d
If this works right, setting Angle (yeah, yeah) switches between an aura circle and a drawn circle. aura is scaled at size 100 being 100% - 200, 200% etc.
nemo
parents:
4521
diff
changeset
|
535 |
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
|
536 |
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
|
537 |
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
|
538 |
Gear:= Gear^.NextGear |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
539 |
end |
4452 | 540 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
541 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
542 |
|
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
|
543 |
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
|
544 |
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
|
545 |
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
|
546 |
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
|
547 |
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
|
548 |
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
|
549 |
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
|
550 |
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
|
551 |
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
|
552 |
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
|
553 |
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
|
554 |
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
|
555 |
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
|
556 |
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
|
557 |
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
|
558 |
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
|
559 |
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
|
560 |
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
|
561 |
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
|
562 |
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
|
563 |
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
|
564 |
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
|
565 |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
566 |
procedure AddClouds; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
567 |
var i: LongInt; |
803 | 568 |
begin |
1132 | 569 |
for i:= 0 to cCloudsNumber - 1 do |
3764 | 570 |
AddVisualGear(cLeftScreenBorder + i * 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
|
571 |
end; |
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
572 |
|
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
|
573 |
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
|
574 |
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
|
575 |
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
|
576 |
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
|
577 |
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
|
578 |
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
|
579 |
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
|
580 |
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
|
581 |
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
|
582 |
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
|
583 |
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
|
584 |
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
|
585 |
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
|
586 |
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
|
587 |
for i:= 0 to cSDCloudsNumber - 1 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
|
588 |
AddVisualGear(cLeftScreenBorder + i * cScreenSpace div (cSDCloudsNumber + 1), LAND_HEIGHT-1184, vgtCloud) |
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
|
589 |
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
|
590 |
|
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
591 |
procedure AddFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
592 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
593 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
594 |
if (cReducedQuality and rqKillFlakes) <> 0 then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
595 |
|
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
596 |
if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
597 |
for i:= 0 to Pred(vobCount) do |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
598 |
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
|
599 |
else |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
600 |
for i:= 0 to Pred(vobCount div 3) do |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
601 |
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
|
602 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
603 |
|
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
604 |
procedure ChangeToSDFlakes; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
605 |
var i: LongInt; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
606 |
vg, tmp: PVisualGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
607 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
608 |
if (cReducedQuality and rqKillFlakes) <> 0 then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
609 |
if vobCount = vobSDCount then exit; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
610 |
vg:= VisualGearsList; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
611 |
while vg <> nil do |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
612 |
if vg^.Kind = vgtFlake then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
613 |
begin |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
614 |
tmp:= vg^.NextGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
615 |
DeleteVisualGear(vg); |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
616 |
vg:= tmp |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
617 |
end |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
618 |
else vg:= vg^.NextGear; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
619 |
if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
620 |
for i:= 0 to Pred(vobSDCount) do |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
621 |
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
|
622 |
else |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
623 |
for i:= 0 to Pred(vobSDCount div 3) do |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
624 |
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
|
625 |
end; |
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4792
diff
changeset
|
626 |
|
3038 | 627 |
procedure initModule; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
628 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2941
diff
changeset
|
629 |
VisualGearsList:= nil; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
630 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
631 |
|
3038 | 632 |
procedure freeModule; |
2715
0e4e0db79e2a
Free up some unfreed memory. Needed for Koda's iphone lib work
nemo
parents:
2713
diff
changeset
|
633 |
begin |
3615 | 634 |
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
|
635 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
636 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
diff
changeset
|
637 |
end. |