Compare commits

...

15 Commits

Author SHA1 Message Date
Pirx 87bc3bfd1e Merge pull request #130 from pkali/develop
v1.14
2022-09-05 23:05:53 -04:00
Pirx 82b4337a1b v1.14 2022-09-05 23:00:18 -04:00
Pecusx d4e616abbb Batter manuals 2022-09-04 20:28:50 +02:00
Pecusx 13e15426fc Tank Hit fix
And TankWidth as variable (definition).
2022-09-02 23:38:56 +02:00
Pecusx dc9c724521 Bouncy Castle and Tracers fixes 2022-09-02 18:00:10 +02:00
Pecusx 216d9f9ca8 Small DrawTanks fix 2022-09-02 14:50:20 +02:00
Pecusx a441357948 More optimizations (158b saved) - please test! 2022-09-02 13:54:57 +02:00
Pecusx aa02b10bda Optimization (10b saved :) ) 2022-09-01 15:06:57 +02:00
Pecusx c4543208bf Minor otimizations (32b saved) 2022-09-01 14:31:58 +02:00
Pecusx 73db3edb45 More AI optimization (59b saved :) ) 2022-08-31 21:09:26 +02:00
Pecusx aa6c37eb61 AI optimizations and more (81b loss :( ) 2022-08-31 20:35:20 +02:00
Pecusx f45cbde341 AI optimization (50b saved) 2022-08-31 17:14:35 +02:00
Pirx c8eb7601c2 align align 2022-08-31 08:43:35 -04:00
Pecusx 3bd870e245 Minor optimizations (9b :) ) 2022-08-31 14:23:16 +02:00
Pecusx dc896f81b0 SoilDown optimization - 63 bytes saved 2022-08-31 10:26:00 +02:00
13 changed files with 367 additions and 442 deletions
+64 -80
View File
@@ -67,107 +67,91 @@ The keyboard controls here are simple, cursor keys or joystick: left/right - cha
* [START] + [OPTION] - immediately force the end of the game (Game Over), just like [O] but without confirmation. * [START] + [OPTION] - immediately force the end of the game (Game Over), just like [O] but without confirmation.
* [ESC] - during the entire game at any time (unless the computer is playing, then sometimes you have to wait a while) you can press the [ESC] key, which allows you to abort the game and return to the beginning (of course, there is protection against accidental pressing). * [ESC] - during the entire game at any time (unless the computer is playing, then sometimes you have to wait a while) you can press the [ESC] key, which allows you to abort the game and return to the beginning (of course, there is protection against accidental pressing).
## 5. Game mechanics ## 5. Game mechanics - offensive weapons
And here's a rundown of the description of how each weapon works, scoring rules, etc: ### Energy of tanks.
- At the beginning of each round, each tank has 99 ash units of energy.
- Tanks' energy is depleted in 3 ways:
* one unit after each shot is fired
* while falling (one pixel down 2 units).
* when a projectile hits the tank or next to it - and here the amount of energy subtracted depends on the distance from the center of the explosion and the type/power of the projectile.
### First, what we know about tank energy ### How energy subtraction works (and earning money!).
- Tanks have energy (and Ogres have layers - like an onion) - 99 units at the start of a round. After each round the amount of money gained/lost is calculated this is done on the basis of two variables accumulated by each tank during the round. These variables are:
- Energy of tanks is depleted in 3 ways:
* one unit after firing each shot,
* while falling (one pixel down takes 2 units of energy),
* when a projectile hits a tank or its proximity. The amount of energy subtracted depends on the distance from the center of the explosion and the type/power of the projectile.
### How energy subtraction works (and makes money!) `gain` - energy "captured" from tanks hit (also if you hit yourself :) and here's the catch, if you have very little energy left it can be profitable to hit yourself with a powerful weapon!
After each round, the amount of money gained/lost is calculated. This is done on the basis of two variables accumulated by each tank during the round. These variables are: `lose` - energy lost due to explosion/fall (and here it is important to count the total loss of energy even if the tank has less at the moment of hit).
`gain` - energy "captured" from hit tanks (also when you hit yourself :) and here's the catch, if you have very little energy left it may be profitable to hit yourself with a powerful weapon! In addition, the tank that won the round has a parameter gain (captured from hit tanks energy) increased by the remaining energy at the end of the round (because it did not die and should have it - although it also happens otherwise :) )
`lose` - energy lost due to explosion/fall (important - the total potential loss of energy is taken into account even if the tank has less at the time of the hit).
In addition, the tank that won the round has a `gain` parameter (captured energy from tanks hit) increased by the energy remaining at the end of the round (because it did not die and should have it - although the survival of the fittest is not guaranteed :) )
Specifically: Specifically:
### After each round: ### After each round:
`money = money + (2 * (gain + energy))` `money = money + (20 * (gain+energy))`.
`money = money - lose` `money = money - (10 * lose)`.
`if money < 0 then money = 0` `if money <0 then money=0`.
(at the start of each round `gain` and `lose` have a value of 0) (at the start of each round `gain` and `lose` have a value of 0).
During a round, if another tank is hit as a result of a shot fired by a tank, the tank firing the shot "gets the energy" taken away from the hit tank. During a round, if another tank is hit as a result of a shot fired by a tank, the tank firing the shot "gets the energy" taken away from the hit tank.
### tank taking a shot:
`gain = gain + EnergyDecrease`.
### tank hit:
`lose = lose + EnergyDecrease`.
### For tank firing a shot: Where `EnergyDecrease` is the loss of energy due to the hit.
`gain = gain + EnergyDecrease` Of course, at the same time the hit tank loses the amount of energy stored in `EnergyDecrease`, except that here the loss cannot exceed the energy you have.
### Tank being hit: ## How a hit works.
`lose = lose + EnergyDecrease` Each weapon that results in an explosion has its own blast radius.
Where `EnergyDecrease` is the loss of energy due to a hit.
Of course, at the same time, the hit tank loses the amount of energy stored in `EnergyDecrease`, except that here the loss can not exceed the energy held.
Note that the screen representation of money has an extra 0 added at the end so you actually have 10 times more cash than the above calculation shows :)
## How the hit works.
Each weapon that results in an explosion has a radius of fire (`ExplosionRadius`).
After the explosion, every tank in its range loses energy. After the explosion, every tank in its range loses energy.
The way it works is that the distance of the hit tank from the center of the explosion is calculated, the `ExplosionRadius` reduced by this distance is multiplied by 8 and the result is `EnergyDecrease`. It works in such a way that if the hit is exactly on the center point of the tank `EnergyDecrease` receives the maximum value for the weapon, and for each pixel of distance from the center of the tank this value is reduced by 8.
That is, in the case of hitting a tank centrally: For example, if a hit with the Baby Missile weapon hits the center of the tank perfectly, it will lose exactly 88 units of energy (plus what it loses falling after the explosion).
`EnergyDecrease = ExplosionRadius * 8` If you hit with the same weapon at a distance of 10 pixels from the center of the tank, the loss will be only 8 units.
and with each pixel farther from the center, 8 fewer units are lost.
I don't know if it's understandable - I do understand it :) And here are the values of maximum energy loss for individual weapons. If a weapon explodes several times, each explosion is calculated independently (additional values in the table):
For example, if a tank is hit centrally with a Baby Missile - it is subtracted 88 units of energy (11 * 8), which also means that when this missile hits at a distance of 12 pixels from the tank - it does not lose energy at all. | Offensive weapons | maximum energy loss |
And here are the `ExplosionRadius` values for each weapon:
| Weapon | `ExplosionRadius` |
| --- | --- | | --- | --- |
| Baby Missile | 11 | | Baby Missile | 88 |
| Missile | 17 | | Missile | 136 |
| Baby Nuke | 25 | | Baby Nuke | 200 |
| Nuke | 30 | | Nuke | 240 |
| LeapFrog| 17 15 13 | | LeapFrog| 136 120 104 |
| Funky Bomb | 21 11 (* 5) | | Funky Bomb | 168 88 (* 5) |
| MIRV | 17 (* 5) | | MIRV | 136 (* 5) |
| Death's Head | 30 (* 5) | | Death's Head | 240 (* 5) |
| Napalm | x 40 (this weapon is different and the distance from the center is not determined, simply any tank within range of the flames loses 40 units of energy - the ExplosionRadius variable is not used) | | Napalm | 40 (this weapon is different and the distance from the center is not determined, simply any tank in range of the flames loses 40 units of energy) |
| Hot Napalm | x 80 (the same principle as in Napalm) | | Hot Napalm | 80 (the rule is the same as in Napalm) |
| Baby Roller | 11 | | Baby Roller | 88 |
| Roller | 21 | | Roller | 168 |
| Heavy Roller | 30 | | Heavy Roller | 240 |
| Riot Charge | 31 | | Riot Charge | 0 (no energy is subtracted, but a portion of the ground upward from the hit point in a 31-pixel radius is removed) |
| Riot Blast | 0 (in reality - 61 but with these weapons it is not taken into account when counting energy loss only the width of the ground to fall) | | Riot Blast | 0 (as in Dirt Charge, but in a radius of 61 pixels) |
| Riot Bomb | 17 | | Riot Bomb | 0 (no energy is subtracted, but the ground in a radius of 17 pixels from the hit point is destroyed - as in the case of Missile. The weapon is useful for digging out after being buried, or for undermining an opponent) |
| Heavy Riot Bomb | 29 | | Heavy Riot Bomb | 0 (as in Riot Bomb, but the explosion radius is 29 pixels from the point of impact - as in the case of Nuke) |
| Baby Digger | 0 (60 - as in Riot Blast) | | Baby Digger | 0 (no energy is subtracted, but a portion of the ground is undermined in a radius of 60 pixels from the point of impact) |
| Digger | 0 (60 - as above) | | Digger | 0 (as above - greater undermining) |
| Heavy Digger | 0 (60 - as above) | | Heavy Digger | 0 (as above - greatest undermining) |
| Baby Sandhog | 0 (60 - as above) | | Baby Sandhog | (as above - another way of undermining) |
| Sandhog | 0 (60 - as above) | | Sandhog | 0 (as above - larger dig) |
| Heavy Sandhog | 0 (60 - as above) | | Heavy Sandhog | 0 (as above - largest dig) |
| Dirt Clod | 12 | | Dirt Clod | 0 (no energy is subtracted, but a ground ball with a radius of 12 pixels from the hit point is created. The weapon is useful for burying the opponent) |
| Dirt Ball | 22 | | Dirt Ball | 0 (as above, but the radius of the ball is 22 pixels) |
| Ton of Dirt | 31 | | Ton of Dirt | 0 (as above, but the radius of the ball is 31 pixels) |
| Liquid Dirt | 0 (maybe it's worth changing?) | | Liquid Dirt | 0 (floods the ground at the point of hit with liquid soil, filling in the depressions) |
| Dirt Charge | 0 (61 - as above) | | Laser | x 100 (but here it is also different - equally 100 only in the case of a direct hit simply subtract 100 units of energy - that is, the tank always dies) |
| Laser | x 100 (but here it is also different - equally 100 only in the case of a direct hit, the `ExplosionRadius` variable is not used, so there is no multiplication by 8 - we simply subtract 100 units of energy - that is, the tank always dies).|
The big points received by the player are the number of tanks that died earlier than him. If any of the other tanks capitulated earlier (using **White Flag**), it is not counted and does not give big points. Large points received by the player is the number of tanks that died earlier than him. If any of the other tanks capitulated earlier (**White Flag**) is not added to those that died and does not give points.
Only these points determine the order in the summary
Only these big points determine the order in the summary.
## 6. And now for defensive weapons: ## 6. And now for defensive weapons:
@@ -209,11 +193,11 @@ The game has 8 difficulty levels of computer-controlled opponents. Or actually 7
** **Tosser** - When attacking, he acts exactly like **Poolshark** however, he may have a "better" weapon inventory due to a different purchase tactic. He always activates the best defensive weapon he has before shooting. And just like **Poolshark** he uses **Battery** and **White Flag**. At the beginning of the round, he assesses how much money he has and depending on that, he makes (money/5100) attempts to buy defensive weapons and then checks again how much money he has left and makes (money/1250) attempts to buy offensive weapons. ** **Tosser** - When attacking, he acts exactly like **Poolshark** however, he may have a "better" weapon inventory due to a different purchase tactic. He always activates the best defensive weapon he has before shooting. And just like **Poolshark** he uses **Battery** and **White Flag**. At the beginning of the round, he assesses how much money he has and depending on that, he makes (money/5100) attempts to buy defensive weapons and then checks again how much money he has left and makes (money/1250) attempts to buy offensive weapons.
** **Chooser** - Takes as a target the weakest opponent (with the least amount of energy) and aims very precisely, but before the shot the energy of the shot is modified by the parameter of luck :) , that is, despite the precise aiming it does not always hit. He shoots with the best weapon he has unless low energy is required (the target is close). Then he changes his weapon to **Baby Missile** to avoid hitting himself. He always activates the best defensive weapon he has before shooting and, like **Poolshark**, uses **Battery** and **White Flag**. He purchases just like **Tosser**. ** **Chooser** - Takes as a target the weakest opponent (with the least amount of energy) and aims very precisely, but before the shot the energy of the shot is modified by the parameter of luck :) , that is, despite the precise aiming it does not always hit. He shoots with the best weapon he has unless the target is close. Then he changes his weapon to **Baby Missile** to avoid hitting himself. He always activates the best defensive weapon he has before shooting and, like **Poolshark**, uses **Battery** and **White Flag**. He purchases just like **Tosser**.
* **Spoiler** - He shoots exactly like **Chooser** except that he has more luck :) , which means that even if he doesn't hit the target of his choice, it can be a more precise shot than **Chooser**. He uses defensive weapons exactly like **Chooser**. At the beginning of the round, he assesses how much money he has and depending on that, he makes (money/5100) attempts to buy defensive weapons and then checks again how much money he has left and makes (money/320) attempts to buy offensive weapons. When buying defensive weapons, he buys only strong and precise weapons - that is, weapons that won't accidentally hurt him. * **Spoiler** - He shoots exactly like **Chooser** except that he has more luck :) , which means that even if he doesn't hit the target of his choice, it can be a more precise shot than **Chooser**. He uses defensive weapons exactly like **Chooser**. At the beginning of the round, he assesses how much money he has and depending on that, he makes (money/5100) attempts to buy defensive weapons and then checks again how much money he has left and makes (money/320) attempts to buy offensive weapons. When buying defensive weapons, he buys only strong and precise weapons - that is, weapons that won't accidentally hurt him.
** **Cyborg** - Takes aim at the weakest opponent (with the least amount of energy) but prefers human-controlled opponents. Aims very accurately and in the vast majority of cases hits on the first shot. He fires the shot with the best weapon he has unless low energy is required (the target is close). Then he changes his weapon to **Baby Missile** to avoid hitting himself. He uses defensive weapons exactly like **Chooser**. He shops exactly like **Spoiler**. ** **Cyborg** - Takes aim at the weakest opponent (with the least amount of energy) but prefers human-controlled opponents. Aims very accurately and in the vast majority of cases hits on the first shot. He fires the shot with the best weapon he has unless the target is close. Then he changes his weapon to **Baby Missile** to avoid hitting himself. He uses defensive weapons exactly like **Chooser**. He shops exactly like **Spoiler**.
* **Unknown** - Before firing each shot, he randomly chooses a course of action from **Poolshark** to **Cyborg** and applies his tactics. However, the tactics of weapon purchases are always identical to **Tosser**. * **Unknown** - Before firing each shot, he randomly chooses a course of action from **Poolshark** to **Cyborg** and applies his tactics. However, the tactics of weapon purchases are always identical to **Tosser**.
@@ -241,9 +225,9 @@ Table of weapons purchased by: **Spoiler** and **Cyborg**.
| Offensive weapons | Defensive weapons | | Offensive weapons | Defensive weapons |
| --- | --- | | --- | --- |
| Baby Nuke | Battery | | Missile | Battery |
| Nuke | Strong Parachute | | Baby Nuke | Strong Parachute |
| Death's Head | Mag Deflector | | Nuke | Mag Deflector |
| Hot Napalm | Heavy Shield | | Hot Napalm | Heavy Shield |
| | Force Shield | | | Force Shield |
| | Bouncy Castle | | | Bouncy Castle |
+45 -55
View File
@@ -66,12 +66,10 @@ Tutaj klawiszologia jest prosta, klawisze kursora lub joystick: lewo/prawo - zmi
* [START] + [OPTION] - natychmiastowe wymuszenie zakończenia gry (Game Over), tak jak [O] ale bez potwierdzenia. * [START] + [OPTION] - natychmiastowe wymuszenie zakończenia gry (Game Over), tak jak [O] ale bez potwierdzenia.
* [ESC] - w czasie całej gry w dowolnym momencie (chyba że akurat gra komputer, wtedy czasem trzeba chwilę poczekać) można nacisnąć klawisz [ESC], który umożliwia przerwanie gry i powrót na początek (oczywiście jest zabezpieczenie przed przypadkowym naciśnięciem). * [ESC] - w czasie całej gry w dowolnym momencie (chyba że akurat gra komputer, wtedy czasem trzeba chwilę poczekać) można nacisnąć klawisz [ESC], który umożliwia przerwanie gry i powrót na początek (oczywiście jest zabezpieczenie przed przypadkowym naciśnięciem).
## 5. Zasady gry ## 5. Zasady gry - bronie ofensywne
A tutaj zręby opisu działania poszczególnych broni, zasad punktacji itp: ### Energia czołgów
- Na początku każdej rundy każdy czołg ma 99 jesnostek energii.
### Najpierw co wiemy o energii czołgów
- Czołgi mają energię (a Ogry warstwy - jak cebula) - na starcie 99 jednostek
- Energii czołgom ubywa na 3 sposoby: - Energii czołgom ubywa na 3 sposoby:
* jedna jednostka po oddaniu każdego strzału * jedna jednostka po oddaniu każdego strzału
* w czasie spadania (jeden piksel w dół 2 jednostki) * w czasie spadania (jeden piksel w dół 2 jednostki)
@@ -89,9 +87,9 @@ Dodatkowo czołg który wygrał rundę ma parametr gain (przechwyconej od trafio
Konkretnie: Konkretnie:
### Po każdej rundzie: ### Po każdej rundzie:
`money = money + (2 * (gain+energy))` `money = money + (20 * (gain+energy))`
`money = money - lose` `money = money - (10 * lose)`
`if money <0 then money=0` `if money <0 then money=0`
@@ -107,58 +105,50 @@ gdzie `EnergyDecrease` to utrata energii w wyniku trafienia.
Oczywiście jednocześnie trafiony czołg traci ilość energii zapisaną w `EnergyDecrease`, z tym że tutaj strata nie może przekroczyć posiadanej energii. Oczywiście jednocześnie trafiony czołg traci ilość energii zapisaną w `EnergyDecrease`, z tym że tutaj strata nie może przekroczyć posiadanej energii.
Uwaga! Ekranowa reprezentacja pieniędzy ma na końcu dopisane dodatkowe 0 więc faktyczne mamy 10 razy więcej kasy niż wynika z powyższych obliczeń :)
## Jak działa trafienie. ## Jak działa trafienie.
Każda broń, która skutkuje eksplozją, ma swój promień rażenia (`ExplosionRadius`). Każda broń, która skutkuje eksplozją, ma swój promień rażenia.
Po eksplozji każdy czołg w jej zasięgu traci energię. Po eksplozji każdy czołg w jej zasięgu traci energię.
Działa to tak, że obliczana jest odległość trafianego czołgu od centrum eksplozji, zmniejszony o tę odległość ExplosionRadius jest mnożony przez 8 i w wyniku otrzymujemy `EnergyDecrease`. Działa to tak, że jeśli trafienie jst dokładnie w centralny punkt czołgu `EnergyDecrease` otrzymuje maksymalną wartość dla danej broni, a za każdym pikselem odległości od centrum czołgu wartość ta jest zmniejszana o 8.
Czyli w przypadku trafienia centralnie w czołg: Przykładowo jeśli strał oddany za pomocą broni Baby Missile trafi idelanie w centum czołgu to straci on dokładnie 88 jednostek energii (plus to co straci spadając po eksplozji).
`EnergyDecrease = ExplosionRadius * 8` W przypadku tafienia tą samą bronią w odległości 10ciu pikseli od centrum czołgu strata ta będzie wynośiła już tyko 8 jednostek.
a z każdym pikselem dalej od centrum ubywa o 8 jednostek mniej. A oto wartości maksymalnego ubytku energii dla poszczególnych broni. Jeśli broń eksploduje kilka razy, każda z eksplozji jest obliczana niezależnie (dodatkowe wartości w tabeli):
Nie wiem czy to zrozumiałe - ja rozumiem :) | Broń ofensywna | maksymalna wartość ubytku energii |
Przykładowo, jeśli czołg zostanie trafiony centralnie przy pomocy Baby Missile - odejmowane jest mu 88 jednostek energii (11 * 8), co także oznacza, że przy trafieniu tym pociskiem w odległości 12 pikseli od czołgu - nie traci on energii wcale.
A oto wartości promienia rażenia (ExplosionRadius) dla poszczególnych broni:
| Weapon | `ExplosionRadius` |
| --- | --- | | --- | --- |
| Baby Missile | 11 | | Baby Missile | 88 |
| Missile | 17 | | Missile | 136 |
| Baby Nuke | 25 | | Baby Nuke | 200 |
| Nuke | 30 | | Nuke | 240 |
| LeapFrog| 17 15 13 | | LeapFrog| 136 120 104 |
| Funky Bomb | 21 11 (* 5) | | Funky Bomb | 168 88 (* 5) |
| MIRV | 17 (* 5) | | MIRV | 136 (* 5) |
| Death's Head | 30 (* 5) | | Death's Head | 240 (* 5) |
| Napalm | x 40 (ta broń jest inna i nie jest wyznaczana odległość od centrum, po prostu każdy czołg znajdujący się w zasięgu płomieni traci 40 jednostek energii - zmienna ExplosionRadius nie jest używana) | | Napalm | 40 (ta broń jest inna i nie jest wyznaczana odległość od centrum, po prostu każdy czołg znajdujący się w zasięgu płomieni traci 40 jednostek energii) |
| Hot Napalm | x 80 (zasada taka jak w Napalm) | | Hot Napalm | 80 (zasada taka jak w Napalm) |
| Baby Roller | 11 | | Baby Roller | 88 |
| Roller | 21 | | Roller | 168 |
| Heavy Roller | 30 | | Heavy Roller | 240 |
| Riot Charge | 31 | | Riot Charge | 0 (nie jest odejmowana energia, ale usuwana jest część gruntu w górę od punktu trafienia w promieniu 31 pikseli) |
| Riot Blast | 0 (tak na prawdę - 61 ale przy tych broniach nie jest brana pod uwagę przy liczeniu ubytku energii tylko szerokości gruntu do opadnięcia) | | Riot Blast | 0 (jak w Dirt Charge, tyle że w promieniu 61 pikseli) |
| Riot Bomb | 17 | | Riot Bomb | 0 (nie jest odejmowana energia, ale niszczony jest grunt w promieniu 17 pikseli od punktu trafienia - tak jak w wypadku Missile. Broń przydatna do odkopywania się po zasypaniu, bądź podkopywania przeciwnika) |
| Heavy Riot Bomb | 29 | | Heavy Riot Bomb | 0 (jak w Riot Bomb, ale promień eksplozji to 29 pikseli od punktu trafienia - tak jak w wypadku Nuke) |
| Baby Digger | 0 (60 - jak w Riot Blast) | | Baby Digger | 0 (nie jest odejmowana energia, ale podkopywana jest część gruntu promieniu 60 pikseli od punktu trafienia) |
| Digger | 0 (60 - jak wyżej) | | Digger | 0 (jak wyżej - większy podkop) |
| Heavy Digger | 0 (60 - jak wyżej) | | Heavy Digger | 0 (jak wyżej - największy podkop) |
| Baby Sandhog | 0 (60 - jak wyżej) | | Baby Sandhog | 0 (jak wyżej - inny sposób podkopywania) |
| Sandhog | 0 (60 - jak wyżej) | | Sandhog | 0 (jak wyżej - większy podkop) |
| Heavy Sandhog | 0 (60 - jak wyżej) | | Heavy Sandhog | 0 (jak wyżej - największy podkop) |
| Dirt Clod | 12 | | Dirt Clod | 0 (nie jest odejmowana energia, ale tworzona jest kula gruntu o promieniu 12 pikseli od punktu trafienia. Broń przydatna do zakopywania przeciwnika) |
| Dirt Ball | 22 | | Dirt Ball | 0 (jak wyżej, ale promień kuli to 22 piksele) |
| Ton of Dirt | 31 | | Ton of Dirt | 0 (jak wyżej, ale promień kuli to 31 pikseli) |
| Liquid Dirt | 0 (może warto to zmienić?) | | Liquid Dirt | 0 (zalewa grunt w punkcie trafienia płynną glebą wypełniając zagłębienia) |
| Dirt Charge | 0 (61 - jak wyżej) | | Dirt Charge | 0 (nie jest odejmowana energia, ale usypywany jest dodatkowy grunt w górę od punktu trafienia w promieniu 61 pikseli. Broń przydatna do zakopywania przeciwnika) |
| Laser | x 100 (ale tu także jest inaczej - równo 100 tylko w przypadku bezpośredniego trafienia, zmienna ExplosionRadius nie jest używana, więc nie ma mnożenia przez 8 - po prostu odejmujemy 100 jednostek energii - czyli czołg zawsze ginie).| | Laser | x 100 (ale tu także jest inaczej - równo 100 tylko w przypadku bezpośredniego trafienia po prostu odejmujemy 100 jednostek energii - czyli czołg zawsze ginie).|
Duże punkty otrzymane przez gracza to ilość czołgów, które zginęły wcześniej niż on. Jeśli któryś z innych czołgów skapitulował wcześniej (Biała Flaga) nie jest doliczany do tych które zginęły i nie daje punktów. Duże punkty otrzymane przez gracza to ilość czołgów, które zginęły wcześniej niż on. Jeśli któryś z innych czołgów skapitulował wcześniej (Biała Flaga) nie jest doliczany do tych które zginęły i nie daje punktów.
Tylko te punkty decydują o kolejności w podsumowaniu Tylko te punkty decydują o kolejności w podsumowaniu
@@ -204,11 +194,11 @@ Gra posiada 8 poziomów trudności przeciwników sterowanych przez komputer. A w
* **Tosser** - Atakując działa dokładnie tak jak **Poolshark** jednak może posiadać "lepszy" zasób broni dzięki innej taktyce zakupów. Zawsze przed strzałem aktywuje najlepszą posiadaną broń defensywną. i tak jak **Poolshark** stosuje **Battery** i **White Flag**. Na początku rundy ocenia ile ma pieniędzy i w zależności od tego podejmuje (pieniądze/5100) prób zakupu broni defensywnych a następnie jeszcze raz sprawdza ile pieniędzy mu zostało i podejmuje (pieniądze/1250) prób zakupu broni ofensywnych. * **Tosser** - Atakując działa dokładnie tak jak **Poolshark** jednak może posiadać "lepszy" zasób broni dzięki innej taktyce zakupów. Zawsze przed strzałem aktywuje najlepszą posiadaną broń defensywną. i tak jak **Poolshark** stosuje **Battery** i **White Flag**. Na początku rundy ocenia ile ma pieniędzy i w zależności od tego podejmuje (pieniądze/5100) prób zakupu broni defensywnych a następnie jeszcze raz sprawdza ile pieniędzy mu zostało i podejmuje (pieniądze/1250) prób zakupu broni ofensywnych.
* **Chooser** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) i celuje bardzo dokładnie, jednak przed samym strzałem energia strzału modyfikowana jest o parametr szczęścia :) , czyli mimo precyzyjnego wycelowania nie zawsze trafia. Strzał oddaje najlepszą posiadaną bronią chyba że wymagana jest małą energia (cel jest blisko). Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Zawsze przed strzałem aktywuje najlepszą posiadaną broń defensywną i tak jak **Poolshark** stosuje **Battery** i **White Flag**. Zakupów dokonuje tak samo jak **Tosser**. * **Chooser** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) i celuje bardzo dokładnie, jednak przed samym strzałem energia strzału modyfikowana jest o parametr szczęścia :) , czyli mimo precyzyjnego wycelowania nie zawsze trafia. Strzał oddaje najlepszą posiadaną bronią chyba że cel jest blisko. Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Zawsze przed strzałem aktywuje najlepszą posiadaną broń defensywną i tak jak **Poolshark** stosuje **Battery** i **White Flag**. Zakupów dokonuje tak samo jak **Tosser**.
* **Spoiler** - Strzela dokładnie tak jak **Chooser** tyle, że ma więcej szczęścia :) , co oznacza że nawet jeśli nie trafi w wybrany cel, to może być to strzał precyzyjniejszy niż **Chooser**. Broni defensywnych używa dokładnie tak jak **Chooser**. Na początku rundy ocenia ile ma pieniędzy i w zależności od tego podejmuje (pieniądze/5100) prób zakupu broni defensywnych a następnie jeszcze raz sprawdza ile pieniędzy mu zostało i podejmuje (pieniądze/320) prób zakupu broni ofensywnych. Przy zakupie broni defensywnych kupuje tylko bronie silne i precyzyjne - czyli takie, które nie zrobią mu przypadkiem krzywdy. * **Spoiler** - Strzela dokładnie tak jak **Chooser** tyle, że ma więcej szczęścia :) , co oznacza że nawet jeśli nie trafi w wybrany cel, to może być to strzał precyzyjniejszy niż **Chooser**. Broni defensywnych używa dokładnie tak jak **Chooser**. Na początku rundy ocenia ile ma pieniędzy i w zależności od tego podejmuje (pieniądze/5100) prób zakupu broni defensywnych a następnie jeszcze raz sprawdza ile pieniędzy mu zostało i podejmuje (pieniądze/320) prób zakupu broni ofensywnych. Przy zakupie broni defensywnych kupuje tylko bronie silne i precyzyjne - czyli takie, które nie zrobią mu przypadkiem krzywdy.
* **Cyborg** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) lecz preferuje przeciwników sterowanych przez człowieka. Celuje bardzo dokładnie i w zdecydowanej większości przypadków trafia za pierwszym strzałem. Strzał oddaje najlepszą posiadaną bronią chyba że wymagana jest małą energia (cel jest blisko). Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Broni defensywnych używa dokładnie tak jak **Chooser**. Zakupy robi dokładnie tak jak **Spoiler** * **Cyborg** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) lecz preferuje przeciwników sterowanych przez człowieka. Celuje bardzo dokładnie i w zdecydowanej większości przypadków trafia za pierwszym strzałem. Strzał oddaje najlepszą posiadaną bronią chyba że cel jest blisko. Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Broni defensywnych używa dokładnie tak jak **Chooser**. Zakupy robi dokładnie tak jak **Spoiler**
* **Unknown** - Przed oddaniem każdego strzału losowo wybiera sposób działania od **Poolsharka** do **Cyborga** i stosuje jego taktykę. Taktyka zakupów broni jest jednak zawsze identyczna jak **Tosser** * **Unknown** - Przed oddaniem każdego strzału losowo wybiera sposób działania od **Poolsharka** do **Cyborga** i stosuje jego taktykę. Taktyka zakupów broni jest jednak zawsze identyczna jak **Tosser**
@@ -236,9 +226,9 @@ Tabela broni kupowanych przez: **Spoiler** i **Cyborg**
| bronie ofensywne | bronie defensywne | | bronie ofensywne | bronie defensywne |
| --- | --- | | --- | --- |
| Baby Nuke | Battery | | Missile | Battery |
| Nuke | Strong Parachute | | Baby Nuke | Strong Parachute |
| Death's Head | Mag Deflector | | Nuke | Mag Deflector |
| Hot Napalm | Heavy Shield | | Hot Napalm | Heavy Shield |
| | Force Shield | | | Force Shield |
| | Bouncy Castle | | | Bouncy Castle |
+15
View File
@@ -48,6 +48,21 @@ With the advent of [fujinet](https://fujinet.online/) we are thinking about maki
## Changes: ## Changes:
###### Version 1.14
2022-09-05
Minor bugfixes and optimizations.
Just a small update to allow for more testing and having fun before the bigger release.
Changes:
* Numerous optimizations that require a solid test. Please have fun and report issues!
* Small DrawTanks fix.
* Bouncy Castle bounces like it should.
* Tracer and Smoke Tracer are not causing defense weapons to trigger anymore.
* In rare cases direct hit was not accounted for correctly.
* Manuals updated.
###### Version 1.13 ###### Version 1.13
2022-08-30 2022-08-30
+77 -81
View File
@@ -8,26 +8,6 @@
; - shoots random direction and force ; - shoots random direction and force
; greeeting to myself 10 years older in 2013-11-09... still no idea ; greeeting to myself 10 years older in 2013-11-09... still no idea
;----------------------------------------------
.proc MakeLowResDistances
; create low precision table of positions
; by dividing positions by 4
ldy #MaxPlayers-1
loop
lda xtankstableL,y
sta temp
lda xtankstableH,y
sta temp+1
;= /4
:2 lsrw temp
lda temp
sta LowResDistances,y
dey
bpl loop
rts
.endp
;---------------------------------------------- ;----------------------------------------------
.proc ArtificialIntelligence ; .proc ArtificialIntelligence ;
@@ -43,6 +23,25 @@ loop
lda AIRoutines,y lda AIRoutines,y
pha pha
;----------------------------------------------
;.proc MakeLowResDistances
; create low precision table of positions
; by dividing positions by 4
ldy #MaxPlayers-1
loop
lda xtankstableL,y
sta temp
lda xtankstableH,y
sta temp+1
;= /4
:2 lsrw temp
lda temp
sta LowResDistances,y
dey
bpl loop
; rts
;.endp
; common values used in AI routines ; common values used in AI routines
; address of weapons table (for future use) ; address of weapons table (for future use)
lda TanksWeaponsTableL,x lda TanksWeaponsTableL,x
@@ -155,13 +154,7 @@ endo
; choose the best weapon ; choose the best weapon
ldy #last_offensive_____ ;the last weapon jsr ChooseBestOffensive
loop
dey
lda (temp),y ; this is set up before calling the routine, has address of TanksWeaponsTable
beq loop
tya
sta ActiveWeapon,x
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
@@ -207,17 +200,7 @@ endo
; choose the best weapon ; choose the best weapon
lda TanksWeaponsTableL,x jsr ChooseBestOffensive
sta temp
lda TanksWeaponsTableH,x
sta temp+1
ldy #ind_Laser__________ ;the last offensive weapon
loop
dey
lda (temp),y
beq loop
tya
sta ActiveWeapon,x
rts rts
;---------------------------------------------- ;----------------------------------------------
@@ -331,17 +314,7 @@ NoUseDefensive
jsr TakeAim ; direction still in A (0 - left, >0 - right) jsr TakeAim ; direction still in A (0 - left, >0 - right)
; choose the best weapon ; choose the best weapon
lda TanksWeaponsTableL,x jsr ChooseBestOffensive
sta temp
lda TanksWeaponsTableH,x
sta temp+1
ldy #ind_LeapFrog_______ ;the last offensive weapon to use
loop
dey
lda (temp),y
beq loop
tya
sta ActiveWeapon,x
; randomizing force +-100 ; randomizing force +-100
sbw Force #100 RandBoundaryLow sbw Force #100 RandBoundaryLow
@@ -350,9 +323,10 @@ loop
NotNegativeEnergy NotNegativeEnergy
adw Force #100 RandBoundaryHigh adw Force #100 RandBoundaryHigh
jsr RandomizeForce jsr RandomizeForce
lda ForceTableH,x ; if target distance lower than 24 - set weapon to Baby Missile (for security :)
bne HighForce jsr GetDistance
; if Force lower than 256 - set weapon to Baby Missile (for security :) ) cmp #6 ; 24/4
bcs HighForce
lda #ind_Baby_Missile___ lda #ind_Baby_Missile___
sta ActiveWeapon,x sta ActiveWeapon,x
HighForce HighForce
@@ -372,17 +346,7 @@ HighForce
jsr TakeAim ; direction still in A (0 - left, >0 - right) jsr TakeAim ; direction still in A (0 - left, >0 - right)
; choose the best weapon ; choose the best weapon
lda TanksWeaponsTableL,x jsr ChooseBestOffensive
sta temp
lda TanksWeaponsTableH,x
sta temp+1
ldy #ind_LeapFrog_______ ;the last offensive weapon to use
loop
dey
lda (temp),y
beq loop
tya
sta ActiveWeapon,x
; randomizing force +-50 ; randomizing force +-50
sbw Force #50 RandBoundaryLow sbw Force #50 RandBoundaryLow
@@ -391,9 +355,10 @@ loop
NotNegativeEnergy NotNegativeEnergy
adw Force #50 RandBoundaryHigh adw Force #50 RandBoundaryHigh
jsr RandomizeForce jsr RandomizeForce
lda ForceTableH,x ; if target distance lower than 24 - set weapon to Baby Missile (for security :)
bne HighForce jsr GetDistance
; if Force lower than 256 - set weapon to Baby Missile (for security :) ) cmp #6 ; 24/4
bcs HighForce
lda #ind_Baby_Missile___ lda #ind_Baby_Missile___
sta ActiveWeapon,x sta ActiveWeapon,x
HighForce HighForce
@@ -412,24 +377,17 @@ HighForce
jsr TakeAim ; direction still in A (0 - left, >0 - right) jsr TakeAim ; direction still in A (0 - left, >0 - right)
; choose the best weapon ; choose the best weapon
lda TanksWeaponsTableL,x ldy #ind_Nuke___________+1
sta temp jsr ChooseBestOffensive.NotFromAll
lda TanksWeaponsTableH,x
sta temp+1
ldy #ind_LeapFrog_______ ;the last offensive weapon to use
loop
dey
lda (temp),y
beq loop
tya
sta ActiveWeapon,x
lda Force lda Force
sta ForceTableL,x sta ForceTableL,x
lda Force+1 lda Force+1
sta ForceTableH,x sta ForceTableH,x
bne HighForce ; if target distance lower than 32 - set weapon to Baby Missile (for security :)
; if Force lower than 256 - set weapon to Baby Missile (for security :) ) jsr GetDistance
cmp #8 ;32/4
bcs HighForce
lda #ind_Baby_Missile___ lda #ind_Baby_Missile___
sta ActiveWeapon,x sta ActiveWeapon,x
HighForce HighForce
@@ -445,7 +403,7 @@ HighForce
; direcion of shoot in A (0 - left, >0 - right) ; direcion of shoot in A (0 - left, >0 - right)
;---------------------------------------------- ;----------------------------------------------
sta PreferHumansFlag sta PreferHumansFlag
jsr MakeLowResDistances ; jsr MakeLowResDistances
lda #202 lda #202
sta temp2 ; max possible energy sta temp2 ; max possible energy
lda #0 lda #0
@@ -497,7 +455,7 @@ skipThisPlayer
; returns target tank number in Y and ; returns target tank number in Y and
; direcion of shoot in A (0 - left, >0 - right) ; direcion of shoot in A (0 - left, >0 - right)
;---------------------------------------------- ;----------------------------------------------
jsr MakeLowResDistances ; jsr MakeLowResDistances
mva #$ff temp2 ; min possible distance mva #$ff temp2 ; min possible distance
mva #0 tempor2 ; direction of shoot mva #0 tempor2 ; direction of shoot
@@ -1052,3 +1010,41 @@ SorryNoPurchase
rts rts
.endp .endp
;----------------------------------------------
.proc ChooseBestOffensive
; choose the best weapon
; X - TankNr
;----------------------------------------------
ldy #last_offensive_____+1 ;the last weapon to choose +1
NotFromAll
; Y - the last offensive weapon to use + 1
lda TanksWeaponsTableL,x
sta temp
lda TanksWeaponsTableH,x
sta temp+1
loop
dey
lda (temp),y
beq loop
tya
sta ActiveWeapon,x
rts
.endp
;----------------------------------------------
.proc GetDistance
; calculates lores ( /4 ) distance from tank X to TargetTankNr(Y)
; result in A
;----------------------------------------------
ldy TargetTankNr
lda LowResDistances,x
cmp LowResDistances,y
@ bcs YisLower
sec
lda LowResDistances,y
sbc LowResDistances,x
rts
YisLower
lda LowResDistances,x
sbc LowResDistances,y
rts
.endp
+1 -1
View File
@@ -397,7 +397,7 @@ PurchaseMeTable2 ;weapons good to be purchased by the robot (Cyborg)
;the comment is an index in the tables ;the comment is an index in the tables
; "Baby Missile ","Missile ","Baby Nuke ","Nuke " ; "Baby Missile ","Missile ","Baby Nuke ","Nuke "
; "LeapFrog ","Funky Bomb ","MIRV ","Death's Head " ; "LeapFrog ","Funky Bomb ","MIRV ","Death's Head "
.by %00110001 .by %01110000
; "Napalm ","Hot Napalm ","Tracer ","Smoke Tracer " ; "Napalm ","Hot Napalm ","Tracer ","Smoke Tracer "
; "Baby Roller ","Roller ","Heavy Roller ","Riot Charge " ; "Baby Roller ","Roller ","Heavy Roller ","Riot Charge "
.by %01000000 .by %01000000
+1
View File
@@ -4,6 +4,7 @@ screenheight = 200
screenBytes = 40 screenBytes = 40
screenwidth = screenBytes*8 ; Max screenwidth = 512!!! screenwidth = screenBytes*8 ; Max screenwidth = 512!!!
TankWidth = 8
;---------------------------------------------- ;----------------------------------------------
; Player/missile memory ; Player/missile memory
PMGraph = $0800 ; real PM start = $0b00 PMGraph = $0800 ; real PM start = $0b00
+37 -40
View File
@@ -1,12 +1,9 @@
; @com.wudsn.ide.asm.mainsourcefile=scorch.asm ; @com.wudsn.ide.asm.mainsourcefile=scorch.asm
.IF *>0 ;this is a trick that prevents compiling this file alone .IF *>0 ;this is a trick that prevents compiling this file alone
; -------------------------------------------------
; .ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!!
;----------------------------------------------- ;-----------------------------------------------
;------------------------
; start of "variables" (RAM) ; start of "variables" (RAM)
; --------------- ;-----------------------------------------------
OptionsHere OptionsHere
; 0123456789012345678901234567890123456789 ; 0123456789012345678901234567890123456789
dta d"Players : 2 3 4 5 6 " dta d"Players : 2 3 4 5 6 "
@@ -105,7 +102,7 @@ DLCreditsAddr
.word GameOverDL .word GameOverDL
;------------------------ ;------------------------
; end of "variables" (RAM) ; end of "variables" (RAM)
; --------------- ;------------------------
; start of "constants" (ROM) ; start of "constants" (ROM)
;----------------------------------------------- ;-----------------------------------------------
;Screen displays go first to avoid crossing 4kb barrier ;Screen displays go first to avoid crossing 4kb barrier
@@ -122,7 +119,6 @@ MoreUp
dta d" more " dta d" more "
dta 92,92,92 dta 92,92,92
dta d" " dta d" "
.ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!!
MoreDown MoreDown
dta d" " dta d" "
dta 93,93,93 dta 93,93,93
@@ -163,40 +159,6 @@ GameOverTitle2
;----------------------------------------------------- ;-----------------------------------------------------
;-------------display-lists--------------------------- ;-------------display-lists---------------------------
;----------------------------------------------------- ;-----------------------------------------------------
OptionsDL
.byte $70
.byte $47
.word OptionsTitle
.byte $70,$70
.byte $42
.word OptionsScreen
.byte $30,$02,$02,$70
.byte $42
.word OptionsHere
.byte $10
:maxOptions-1 .by $02,$10
:(9-maxOptions) .by $70,$10
.byte $80
.byte $4f
.word (display+140*40)
:21 .by $0f ;76
.byte $41
.word OptionsDL
;------------------------
;Enter names of tanks DL
NameDL
.byte $70
.byte $47
.word DifficultyTitle
.byte $70,$70
.byte $42
.word NameScreen
.byte $30
.byte $02,$30+$80,$02
.byte $10,$02,$02,$02,$30,$02,$02
.byte $41
.word NameDL
; -------------------------------------------------
dl ; MAIN game display list dl ; MAIN game display list
.byte 0 .byte 0
@@ -245,6 +207,41 @@ dl ; MAIN game display list
.byte $41 .byte $41
.word dl .word dl
;----------------------------------------------- ;-----------------------------------------------
.ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!!
OptionsDL
.byte $70
.byte $47
.word OptionsTitle
.byte $70,$70
.byte $42
.word OptionsScreen
.byte $30,$02,$02,$70
.byte $42
.word OptionsHere
.byte $10
:maxOptions-1 .by $02,$10
:(9-maxOptions) .by $70,$10
.byte $80
.byte $4f
.word (display+140*40)
:21 .by $0f ;76
.byte $41
.word OptionsDL
;------------------------
;Enter names of tanks DL
NameDL
.byte $70
.byte $47
.word DifficultyTitle
.byte $70,$70
.byte $42
.word NameScreen
.byte $30
.byte $02,$30+$80,$02
.byte $10,$02,$02,$02,$30,$02,$02
.byte $41
.word NameDL
; -------------------------------------------------
GameOverResults = display+$0ff0 ; reuse after game GameOverResults = display+$0ff0 ; reuse after game
Credits = GameOverResults +(6*40) Credits = GameOverResults +(6*40)
CreditsLastLine = Credits + (CreditsLines*40) CreditsLastLine = Credits + (CreditsLines*40)
+37 -35
View File
@@ -584,6 +584,11 @@ UnequalTanks
.endp .endp
;------------------------------------------------- ;-------------------------------------------------
.proc ClearTanks
jsr PMoutofScreen
mva #1 Erase ; erase tanks flag
.endp
;--
.proc drawtanks .proc drawtanks
;------------------------------------------------- ;-------------------------------------------------
lda TankNr lda TankNr
@@ -601,6 +606,7 @@ DrawNextTank
pla pla
sta TankNr sta TankNr
mva #0 Erase ; no erase tanks flag
rts rts
.endp .endp
;--------- ;---------
@@ -645,7 +651,8 @@ DrawTankNrX
jsr SetupXYdraw jsr SetupXYdraw
jsr TypeChar jsr TypeChar
lda Erase
jne noTankNoPM
; now P/M graphics on the screen (only for 5 tanks) ; now P/M graphics on the screen (only for 5 tanks)
; horizontal position ; horizontal position
ldx TankNr ldx TankNr
@@ -729,7 +736,7 @@ ZeroesToGo6
bne ClearPM6 bne ClearPM6
NoPlayerMissile NoPlayerMissile
noTankNoPM
ldy #$01 ldy #$01
lda Erase lda Erase
beq @+ beq @+
@@ -1130,10 +1137,10 @@ FallingRight
bvs EndRightFall bvs EndRightFall
; we finish falling right if the tank reached the edge of the screen ; we finish falling right if the tank reached the edge of the screen
lda XtanksTableH,x lda XtanksTableH,x
cmp #>(screenwidth-8-2) ; 2 pixels correction due to a barrel wider than tank cmp #>(screenwidth-TankWidth-2) ; 2 pixels correction due to a barrel wider than tank
bne @+ bne @+
lda XtanksTableL,x lda XtanksTableL,x
cmp #<(screenwidth-8-2) ; 2 pixels correction due to a barrel wider than tank cmp #<(screenwidth-TankWidth-2) ; 2 pixels correction due to a barrel wider than tank
@ bcs EndRightFall @ bcs EndRightFall
NotRightEdge NotRightEdge
; tank is falling right - modify coorinates ; tank is falling right - modify coorinates
@@ -1263,20 +1270,37 @@ drawmountainsloop
beq NoMountain beq NoMountain
sta ydraw sta ydraw
sty ydraw+1 sty ydraw+1
jsr DrawLine ; jsr DrawLine
; there was Drawline proc
lda #screenheight
sec
sbc ydraw
sta tempbyte01
jsr plot.MakePlot
; after plot we have: (xbyte),y - addres of screen byte; X - index in bittable (number of bit)
; jmp IntoDraw ; jumps inside Draw routine
; because one pixel is already plotted (and who cares? :) )
@
lda (xbyte),y
and bittable2,x
sta (xbyte),y
;IntoDraw
adw xbyte #screenBytes
dec tempbyte01
bne @-
; end of Drawline proc
NoMountain NoMountain
inw modify inw modify
inw xdraw inw xdraw
cpw xdraw #screenwidth cpw xdraw #screenwidth
bne drawmountainsloop bne drawmountainsloop
rts rts
/*
;-------------------------------------------------- ;--------------------------------------------------
drawmountainspixel drawmountainspixel ; never used ?
;-------------------------------------------------- ;--------------------------------------------------
mwa #0 xdraw mwa #0 xdraw
mwa #mountaintable modify mwa #mountaintable modify
drawmountainspixelloop drawmountainspixelloop
ldy #0 ldy #0
lda (modify),y lda (modify),y
@@ -1287,8 +1311,8 @@ drawmountainspixelloop
inw xdraw inw xdraw
cpw xdraw #screenwidth cpw xdraw #screenwidth
bne drawmountainspixelloop bne drawmountainspixelloop
rts rts
*/
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc SoilDown2 .proc SoilDown2
@@ -1317,8 +1341,8 @@ drawmountainspixelloop
; how it works. I have just translated Polish comment ; how it works. I have just translated Polish comment
; but I do not understand a word of it :) ; but I do not understand a word of it :)
; If you know how it works, please write here :)))) ; If you know how it works, please write here :))))
jsr ClearTanks
jsr PMoutofscreen NoClearTanks
; First we look for highest pixels and fill with their coordinates ; First we look for highest pixels and fill with their coordinates
; both tables ; both tables
@@ -1416,6 +1440,7 @@ ColumnIsReady
; now correct heights are in the mountaintable ; now correct heights are in the mountaintable
sta color ; Pozor! :) we know - now A=1 sta color ; Pozor! :) we know - now A=1
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
jsr DrawTanks
rts rts
.endp .endp
@@ -1761,31 +1786,8 @@ ClearPlot
eor #$ff eor #$ff
and bittable,x and bittable,x
rts rts
.endp;--------------------------------------------------
.proc DrawLine
;--------------------------------------------------
mva #0 ydraw+1
lda #screenheight
sec
sbc ydraw
sta tempbyte01
jsr plot.MakePlot
;rts
jmp IntoDraw ; jumps inside Draw routine
; because one pixel is already plotted
@
lda (xbyte),y
and bittable2,x
sta (xbyte),y
IntoDraw
adw xbyte #screenBytes
dec tempbyte01
bne @-
rts
.endp .endp
;--------------------------------------------------
; ------------------------------------------
.proc TypeChar .proc TypeChar
; puts char on the graphics screen ; puts char on the graphics screen
; in: CharCode ; in: CharCode
+16 -32
View File
@@ -36,7 +36,7 @@
;we decided it must go in 'English' to let other people work on it ;we decided it must go in 'English' to let other people work on it
.macro build .macro build
dta d"1.13" ; number of this build (3 bytes) dta d"1.14" ; number of this build (3 bytes)
.endm .endm
icl 'definitions.asm' icl 'definitions.asm'
@@ -103,7 +103,7 @@
.zpvar Counter .byte ;temporary Counter for outside loops .zpvar Counter .byte ;temporary Counter for outside loops
.zpvar ExplosionRadius .word ;because when adding in xdraw it is double byte .zpvar ExplosionRadius .word ;because when adding in xdraw it is double byte
.zpvar ResultY .byte .zpvar ResultY .byte
.zpvar FallDown2 .byte ; .zpvar FallDown2 .byte
.zpvar xcircle .word .zpvar xcircle .word
.zpvar ycircle .word .zpvar ycircle .word
.zpvar vy .word .zpvar vy .word
@@ -171,8 +171,7 @@ WeaponFont
; Game Code ; Game Code
;-------------------------------------------------- ;--------------------------------------------------
FirstSTART FirstSTART
mva #0 dmactls ; dark screen jsr MakeDarkScreen
jsr WaitOneFrame
; one time zero variables in RAM (non zero page) ; one time zero variables in RAM (non zero page)
lda #0 lda #0
@@ -227,14 +226,12 @@ START
jsr Options ;startup screen jsr Options ;startup screen
mva #0 dmactls ; dark screen jsr MakeDarkScreen
jsr WaitOneFrame
bit escFlag bit escFlag
bmi START bmi START
jsr EnterPlayerNames jsr EnterPlayerNames
mva #0 dmactls ; dark screen jsr MakeDarkScreen
jsr WaitOneFrame
bit escFlag bit escFlag
bmi START bmi START
@@ -255,8 +252,7 @@ SettingBarrel
jsr CallPurchaseForEveryTank jsr CallPurchaseForEveryTank
; issue #72 (glitches when switches) ; issue #72 (glitches when switches)
mva #0 dmactls ; dark screen jsr MakeDarkScreen
jsr WaitOneFrame
bit escFlag bit escFlag
bmi START bmi START
@@ -275,11 +271,8 @@ SettingBarrel
jsr SortSequence jsr SortSequence
; Hide all (easier than hide last ;) ) tanks ; Hide all (easier than hide last ;) ) tanks
mva #1 Erase jsr cleartanks
jsr drawtanks
mva #0 Erase
sta COLBAKS ; set background color to black sta COLBAKS ; set background color to black
jsr PMoutofScreen ;let P/M disappear
; here gains and losses should be displayed (dollars) ; here gains and losses should be displayed (dollars)
; finally we have changed our minds and money of players ; finally we have changed our minds and money of players
@@ -386,14 +379,12 @@ eskipzeroing
lda GameIsOver lda GameIsOver
beq NoGameOverYet beq NoGameOverYet
GoGameOver GoGameOver
mva #0 dmactls ; dark screen jsr MakeDarkScreen
jsr WaitOneFrame
jsr GameOverScreen jsr GameOverScreen
jmp START jmp START
NoGameOverYet NoGameOverYet
inc CurrentRoundNr inc CurrentRoundNr
lda #$0 jsr MakeDarkScreen ; issue #72
sta dmactls ; issue #72
jsr RmtSongSelect jsr RmtSongSelect
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
jsr PMoutofscreen jsr PMoutofscreen
@@ -642,8 +633,7 @@ ShootNow
beq missed beq missed
lda #0 lda #0
sta FallDown1 ; sta FallDown2
sta FallDown2
jsr Explosion jsr Explosion
continueMainRoundLoopAfterSeppuku continueMainRoundLoopAfterSeppuku
@@ -654,14 +644,7 @@ continueMainRoundLoopAfterSeppuku
AfterExplode AfterExplode
;temporary tanks removal (would fall down with soil) jsr SoilDown2 ; allways
mva #1 Erase
jsr drawtanks
mva #0 Erase
lda FallDown2
beq NoFallDown2
jsr SoilDown2
NoFallDown2 NoFallDown2
;here tanks are falling down ;here tanks are falling down
mva tankNr tempor2 mva tankNr tempor2
@@ -811,8 +794,7 @@ NoPlayerNoDeath
;cleanup of the soil fall down ranges (left and right) ;cleanup of the soil fall down ranges (left and right)
sta RangeRight sta RangeRight
sta RangeRight+1 sta RangeRight+1
sta FallDown1 ; sta FallDown2
sta FallDown2
mwa #screenwidth RangeLeft mwa #screenwidth RangeLeft
; We are randomizing the weapon now. ; We are randomizing the weapon now.
@@ -919,8 +901,7 @@ NotNegativeShieldEnergy
;--------------------------------- ;---------------------------------
.proc Seppuku .proc Seppuku
lda #0 lda #0
sta FallDown1 ;sta FallDown2
sta FallDown2
sta ydraw+1 sta ydraw+1
; get position of the tank ; get position of the tank
ldx TankNr ldx TankNr
@@ -1632,6 +1613,9 @@ peopleAreHere
noKey noKey
rts rts
.endp .endp
MakeDarkScreen
mva #0 dmactls ; dark screen
; and wait one frame :)
.proc WaitOneFrame .proc WaitOneFrame
lda CONSOL lda CONSOL
and #%00000101 ; Start + Option and #%00000101 ; Start + Option
BIN
View File
Binary file not shown.
+8 -9
View File
@@ -789,18 +789,18 @@ Suprise ; get a random weapon
cmp #51 ; defensive weapons are less likely because they are more expensive - probability 255:51 (5:1) cmp #51 ; defensive weapons are less likely because they are more expensive - probability 255:51 (5:1)
bcc GetRandomDefensive bcc GetRandomDefensive
GetRandomOffensive GetRandomOffensive
randomize ind_Missile________ ind_Laser__________ randomize ind_Missile________ last_offensive_____
cmp #ind_Buy_me_________ cmp #ind_Buy_me_________
beq GetRandomOffensive beq GetRandomOffensive
tay tay
lda WeaponUnits,y ; check if weapon exist ; lda WeaponUnits,y ; check if weapon exist
beq GetRandomOffensive ; beq GetRandomOffensive
bne NoSuprise ; Y always <> 0 bne NoSuprise ; Y always <> 0
GetRandomDefensive GetRandomDefensive
randomize ind_Battery________ ind_Nuclear_Winter_ randomize ind_Battery________ last_defensive_____
tay tay
lda WeaponUnits,y ; check if weapon exist ; lda WeaponUnits,y ; check if weapon exist
beq GetRandomDefensive ; beq GetRandomDefensive
NoSuprise NoSuprise
lda TanksWeaponsTableL,x lda TanksWeaponsTableL,x
@@ -1267,7 +1267,7 @@ NotFirstLetter
cpy PositionInName cpy PositionInName
bne @+ bne @+
ora #$80 ; place cursor ora #$80 ; place cursor
@ sta NameAdr,y @ sta NameAdr,y
dey dey
bpl CursorLoop bpl CursorLoop
rts rts
@@ -2161,8 +2161,7 @@ FastTank
bpl AllTanksFloatingDown bpl AllTanksFloatingDown
jsr IsKeyPressed jsr IsKeyPressed
bne MainTanksFloatingLoop ; neverending loop bne MainTanksFloatingLoop ; neverending loop
mva #0 dmactls ; dark screen jsr MakeDarkScreen
jsr WaitOneFrame
jsr GameOverResultsClear jsr GameOverResultsClear
rts rts
RandomizeTankPos RandomizeTankPos
-1
View File
@@ -315,7 +315,6 @@ decimalresult .DS 5
;ExplosionRadius .DS 2 ;because when adding in xdraw it is double byte ;ExplosionRadius .DS 2 ;because when adding in xdraw it is double byte
;round ;round
CurrentRoundNr .DS 1 CurrentRoundNr .DS 1
FallDown1 .DS 1
;FallDown2 .DS 1 ;FallDown2 .DS 1
;leapfrog ;leapfrog
LeapFrogAngle .DS 1 LeapFrogAngle .DS 1
+66 -108
View File
@@ -17,6 +17,7 @@
pha pha
lda ExplosionRoutines,x lda ExplosionRoutines,x
pha pha
; inc FallDown2
rts rts
ExplosionRoutines ExplosionRoutines
.word babymissile-1 ;Baby_Missile___;_00 .word babymissile-1 ;Baby_Missile___;_00
@@ -61,54 +62,41 @@ tracer
; ------------------------ ; ------------------------
.proc babymissile .proc babymissile
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
inc FallDown2 ; inc FallDown2
mva #11 ExplosionRadius mva #11 ExplosionRadius
jsr CalculateExplosionRange
jmp xmissile jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc missile ; .proc missile ;
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
inc FallDown2 ; inc FallDown2
mva #17 ExplosionRadius mva #17 ExplosionRadius
jsr CalculateExplosionRange
jmp xmissile jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc babynuke .proc babynuke
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
inc FallDown2 ; inc FallDown2
mva #25 ExplosionRadius mva #25 ExplosionRadius
jsr CalculateExplosionRange
jmp xmissile jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc nuke .proc nuke
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
inc FallDown2 ; inc FallDown2
mva #30 ExplosionRadius mva #30 ExplosionRadius
jsr CalculateExplosionRange
jmp xmissile jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc leapfrog .proc leapfrog
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
inc FallDown2 ; inc FallDown2
mva #17 ExplosionRadius mva #17 ExplosionRadius
jsr CalculateExplosionRange
jsr xmissile jsr xmissile
; soil must fall down now! there is no other way... ; soil must fall down now! there is no other way...
; hide tanks or they fall down with soil ; hide tanks or they fall down with soil
lda TankNr
pha
mva #1 Erase
jsr drawtanks
mva #0 Erase
jsr SoilDown2 jsr SoilDown2
jsr drawtanks
pla
sta TankNr
; it looks like force is divided by 4 here BUT" ; it looks like force is divided by 4 here BUT"
; in Flight routine force is multiplied by 2 and left ; in Flight routine force is multiplied by 2 and left
@@ -127,19 +115,11 @@ tracer
mva #15 ExplosionRadius mva #15 ExplosionRadius
jsr CalculateExplosionRange0 jsr CalculateExplosionRange0
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
jsr xmissile jsr xmissile.NoRangeCalc
; soil must fall down now! there is no other way... ; soil must fall down now! there is no other way...
; hide tanks or they fall down with soil ; hide tanks or they fall down with soil
lda TankNr
pha
mva #1 Erase
jsr drawtanks
mva #0 Erase
jsr SoilDown2 jsr SoilDown2
jsr drawtanks
pla
sta TankNr
; it looks like force is divided by 4 here BUT" ; it looks like force is divided by 4 here BUT"
; in Flight routine force is multiplied by 2 and left ; in Flight routine force is multiplied by 2 and left
@@ -157,13 +137,13 @@ tracer
mva #13 ExplosionRadius mva #13 ExplosionRadius
jsr CalculateExplosionRange0 jsr CalculateExplosionRange0
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
jmp xmissile jmp xmissile.NoRangeCalc
EndOfLeapping EndOfLeapping
rts rts
.endp .endp
; ------------------------ ; ------------------------
.proc mirv ; the whole mirv is performed by Flight routine .proc mirv ; the whole mirv is performed by Flight routine
inc FallDown2 ; inc FallDown2
rts rts
.endp .endp
; ------------------------ ; ------------------------
@@ -171,26 +151,16 @@ EndOfLeapping
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
mwa xtraj+1 xtrajfb mwa xtraj+1 xtrajfb
sbw ytraj+1 #$05 ytrajfb ; funky missiles start point goes 5 pixel UP to prevent multiple explosion at one point if tank is hit (4 pixels tank height + 1) sbw ytraj+1 #$05 ytrajfb ; funky missiles start point goes 5 pixel UP to prevent multiple explosion at one point if tank is hit (4 pixels tank height + 1)
inc FallDown2 ; inc FallDown2
;central Explosion ;central Explosion
mva #21 ExplosionRadius mva #21 ExplosionRadius
jsr CalculateExplosionRange0 jsr CalculateExplosionRange0
jsr xmissile jsr xmissile.NoRangeCalc
lda TankNr
pha
mva #1 Erase
jsr drawtanks
mva #0 Erase
jsr SoilDown2 jsr SoilDown2
; ;
mva #1 Erase jsr cleartanks ; maybe not?
jsr drawtanks
mva #0 Erase
sta FunkyWallFlag sta FunkyWallFlag
pla
sta TankNr
mva #1 color mva #1 color
mva #5 FunkyBombCounter mva #5 FunkyBombCounter
FunkyBombLoop FunkyBombLoop
@@ -211,7 +181,6 @@ FunkyBombLoop
mva #sfx_funky_hit sfx_effect mva #sfx_funky_hit sfx_effect
jsr Flight jsr Flight
jsr CalculateExplosionRange
lda HitFlag lda HitFlag
beq NoExplosionInFunkyBomb beq NoExplosionInFunkyBomb
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
@@ -229,22 +198,18 @@ NoWallsInFunky
.endp .endp
; ------------------------ ; ------------------------
.proc deathshead .proc deathshead
inc FallDown2 ; inc FallDown2
mva #30 ExplosionRadius mva #30 ExplosionRadius
jsr CalculateExplosionRange
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY SaveDrawXY
jsr xmissile jsr xmissile
UnSaveDrawXY UnSaveDrawXY
sbw xdraw #34 sbw xdraw #34
jsr CalculateExplosionRange
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY SaveDrawXY
jsr xmissile jsr xmissile
UnSaveDrawXY UnSaveDrawXY
adw xdraw #68 adw xdraw #68
jsr CalculateExplosionRange
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY SaveDrawXY
jsr xmissile jsr xmissile
@@ -285,7 +250,7 @@ NoLowerCircle
; ------------------------ ; ------------------------
.proc napalm .proc napalm
mva #sfx_napalm sfx_effect mva #sfx_napalm sfx_effect
inc FallDown2 ; inc FallDown2
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width) mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
jsr CalculateExplosionRange jsr CalculateExplosionRange
mva #0 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm mva #0 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
@@ -294,7 +259,7 @@ NoLowerCircle
; ------------------------ ; ------------------------
.proc hotnapalm .proc hotnapalm
mva #sfx_napalm sfx_effect mva #sfx_napalm sfx_effect
inc FallDown2 ; inc FallDown2
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width) mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
jsr CalculateExplosionRange jsr CalculateExplosionRange
mva #1 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm mva #1 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
@@ -359,7 +324,7 @@ CharOffTheScreen
dec magic dec magic
jpl RepeatNapalm jpl RepeatNapalm
; after napalm ; after napalm
inc FallDown2 ; inc FallDown2
;now we must check tanks in range ;now we must check tanks in range
ldx NumberOfPlayers ldx NumberOfPlayers
dex dex
@@ -378,7 +343,7 @@ BurnedCheckLoop
@ @
bcs TankOutOfFire bcs TankOutOfFire
; let's calculate left edge of the fire ; let's calculate left edge of the fire
sbw xcircle #(napalmRadius+8+4-4) xdraw ; 10 pixels on left + character width (tank) + half character - correction sbw xcircle #(napalmRadius+TankWidth+4-4) xdraw ; 10 pixels on left + character width (tank) + half character - correction
bpl @+ bpl @+
mwa #0 xdraw ; left screen edge mwa #0 xdraw ; left screen edge
@ @
@@ -407,32 +372,32 @@ EndNurnedCheckLoop
.endp .endp
; ------------------------ ; ------------------------
.proc babyroller .proc babyroller
inc FallDown2 ; inc FallDown2
mva #11 ExplosionRadius mva #11 ExplosionRadius
jmp xroller jmp xroller
.endp .endp
; ------------------------ ; ------------------------
.proc roller ; .proc roller ;
inc FallDown2 ; inc FallDown2
mva #21 ExplosionRadius mva #21 ExplosionRadius
jmp xroller jmp xroller
.endp .endp
; ------------------------ ; ------------------------
.proc heavyroller .proc heavyroller
inc FallDown2 ; inc FallDown2
mva #30 ExplosionRadius mva #30 ExplosionRadius
jmp xroller jmp xroller
.endp .endp
; ------------------------ ; ------------------------
.proc riotbomb .proc riotbomb
inc FallDown2 ; inc FallDown2
mva #17 ExplosionRadius mva #17 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp xriotbomb jmp xriotbomb
.endp .endp
; ------------------------ ; ------------------------
.proc heavyriotbomb .proc heavyriotbomb
inc FallDown2 ; inc FallDown2
mva #29 ExplosionRadius mva #29 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp xriotbomb jmp xriotbomb
@@ -441,7 +406,7 @@ EndNurnedCheckLoop
.proc babydigger .proc babydigger
mva #sfx_digger sfx_effect mva #sfx_digger sfx_effect
mva #0 sandhogflag mva #0 sandhogflag
inc FallDown2 ; inc FallDown2
mva #13 DigLong mva #13 DigLong
mva #1 diggery ; how many branches (-1) mva #1 diggery ; how many branches (-1)
jmp xdigger jmp xdigger
@@ -450,7 +415,7 @@ EndNurnedCheckLoop
.proc digger ; .proc digger ;
mva #sfx_digger sfx_effect mva #sfx_digger sfx_effect
mva #0 sandhogflag mva #0 sandhogflag
inc FallDown2 ; inc FallDown2
mva #13 DigLong mva #13 DigLong
mva #3 diggery ; how many branches (-1) mva #3 diggery ; how many branches (-1)
jmp xdigger jmp xdigger
@@ -459,7 +424,7 @@ EndNurnedCheckLoop
.proc heavydigger .proc heavydigger
mva #sfx_digger sfx_effect mva #sfx_digger sfx_effect
mva #0 sandhogflag mva #0 sandhogflag
inc FallDown2 ; inc FallDown2
mva #13 DigLong mva #13 DigLong
mva #7 diggery ; how many branches (-1) mva #7 diggery ; how many branches (-1)
jmp xdigger jmp xdigger
@@ -583,7 +548,7 @@ DiggerCharacter
.proc babysandhog .proc babysandhog
mva #sfx_sandhog sfx_effect mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag mva #char_sandhog_offset sandhogflag
inc FallDown2 ; inc FallDown2
mva #13 DigLong mva #13 DigLong
mva #1 diggery ; how many branches (-1) mva #1 diggery ; how many branches (-1)
jmp xdigger jmp xdigger
@@ -592,7 +557,7 @@ DiggerCharacter
.proc sandhog .proc sandhog
mva #sfx_sandhog sfx_effect mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag mva #char_sandhog_offset sandhogflag
inc FallDown2 ; inc FallDown2
mva #13 DigLong mva #13 DigLong
mva #3 diggery ; how many branches (-1) mva #3 diggery ; how many branches (-1)
jmp xdigger jmp xdigger
@@ -601,35 +566,35 @@ DiggerCharacter
.proc heavysandhog .proc heavysandhog
mva #sfx_sandhog sfx_effect mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag mva #char_sandhog_offset sandhogflag
inc FallDown2 ; inc FallDown2
mva #13 DigLong mva #13 DigLong
mva #5 diggery ; how many branches (-1) mva #5 diggery ; how many branches (-1)
jmp xdigger jmp xdigger
.endp .endp
; ------------------------ ; ------------------------
.proc dirtclod .proc dirtclod
inc FallDown2 ; inc FallDown2
mva #12 ExplosionRadius mva #12 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp xdirt jmp xdirt
.endp .endp
; ------------------------ ; ------------------------
.proc dirtball .proc dirtball
inc FallDown2 ; inc FallDown2
mva #22 ExplosionRadius mva #22 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp xdirt jmp xdirt
.endp .endp
; ------------------------ ; ------------------------
.proc tonofdirt .proc tonofdirt
inc FallDown2 ; inc FallDown2
mva #31 ExplosionRadius mva #31 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp xdirt jmp xdirt
.endp .endp
; ------------------------ ; ------------------------
.proc dirtcharge .proc dirtcharge
inc FallDown2 ; inc FallDown2
mva #61 ExplosionRadius mva #61 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp ofdirt jmp ofdirt
@@ -637,7 +602,7 @@ DiggerCharacter
; ------------------------ ; ------------------------
.proc riotcharge .proc riotcharge
mva #sfx_riot_blast sfx_effect mva #sfx_riot_blast sfx_effect
inc FallDown2 ; inc FallDown2
mva #31 ExplosionRadius mva #31 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp cleanDirt jmp cleanDirt
@@ -645,7 +610,7 @@ DiggerCharacter
; ------------------------ ; ------------------------
.proc riotblast .proc riotblast
mva #sfx_riot_blast sfx_effect mva #sfx_riot_blast sfx_effect
inc FallDown2 ; inc FallDown2
mva #61 ExplosionRadius mva #61 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp cleanDirt jmp cleanDirt
@@ -719,6 +684,8 @@ LaserMisses
; ----------------- ; -----------------
.proc xmissile ; .proc xmissile ;
; ----------------- ; -----------------
jsr CalculateExplosionRange
NoRangeCalc
lda #1 lda #1
sta radius sta radius
sta color sta color
@@ -930,7 +897,6 @@ ExplodeNow
mwa ycircle ydraw ;(bad) mwa ycircle ydraw ;(bad)
; finally a little explosion ; finally a little explosion
jsr CalculateExplosionRange
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
jmp xmissile jmp xmissile
rts rts
@@ -1135,7 +1101,6 @@ ToHighFill
;first, get current parameters (angle+force) ;first, get current parameters (angle+force)
;for an active tank and display them ;for an active tank and display them
;(these values are taken from the previous round) ;(these values are taken from the previous round)
mva #0 Erase
ldx TankNr ldx TankNr
@@ -1152,6 +1117,7 @@ ContinueToCheckMaxForce2
lda MaxForceTableL,x lda MaxForceTableL,x
sta ForceTableL,x sta ForceTableL,x
@ @
mva #0 Erase
jsr DisplayStatus ;all digital values like force, angle, wind, etc. jsr DisplayStatus ;all digital values like force, angle, wind, etc.
jsr PutTankNameOnScreen jsr PutTankNameOnScreen
@@ -1211,9 +1177,7 @@ QuitToGameover
bne @+ bne @+
callActivation callActivation
; Hide all tanks - after inventory they may have other shapes ; Hide all tanks - after inventory they may have other shapes
mva #1 Erase jsr ClearTanks
jsr DrawTanks
mva #0 Erase
jsr DefensivesActivate jsr DefensivesActivate
jmp afterInventory jmp afterInventory
@@ -1222,15 +1186,12 @@ callActivation
bne @+ bne @+
callInventory callInventory
; Hide all tanks - after inventory they may have other shapes ; Hide all tanks - after inventory they may have other shapes
mva #1 Erase jsr ClearTanks
jsr DrawTanks
mva #0 Erase
; ;
mva #$ff isInventory mva #$ff isInventory
jsr Purchase jsr Purchase
afterInventory afterInventory
mva #0 dmactls ; dark screen jsr MakeDarkScreen
jsr WaitOneFrame
lda #song_ingame lda #song_ingame
jsr RmtSongSelect jsr RmtSongSelect
mva #0 escFlag mva #0 escFlag
@@ -1905,12 +1866,19 @@ EndOfFlight2
@ @
; tank hit - check defensive weapon of this tank ; tank hit - check defensive weapon of this tank
tax tax
dex ; index of tank in X dex ; index of hitted tank in X
ldy TankNr
lda ActiveWeapon,y
cmp #ind_Tracer_________ ; defence not fire by tracers
beq JNoDefence
cmp #ind_Smoke_Tracer___
beq JNoDefence
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #ind_Bouncy_Castle__ ; Auto Defence cmp #ind_Bouncy_Castle__ ; Auto Defence
jeq BouncyCastle jeq BouncyCastle
cmp #ind_Mag_Deflector__ ; Mag Deflector cmp #ind_Mag_Deflector__ ; Mag Deflector
beq MagDeflector beq MagDeflector
JNoDefence
jmp NoDefence jmp NoDefence
MagDeflector MagDeflector
; now run defensive-aggressive weapon - Mag Deflector! ; now run defensive-aggressive weapon - Mag Deflector!
@@ -1960,8 +1928,6 @@ NoDefence
BouncyCastle BouncyCastle
mva #sfx_shield_on sfx_effect mva #sfx_shield_on sfx_effect
; now run defensive-aggressive weapon - Bouncy Castle (previously known as Auto Defence)! ; now run defensive-aggressive weapon - Bouncy Castle (previously known as Auto Defence)!
sbb #180 LeapFrogAngle Angle ; swap angle (LeapFrogAngle - because we have strored angle in this variable)
lsrw Force ; Force = Force / 2 - because earlier we multiplied by 2
mva #1 Erase mva #1 Erase
lda TankNr lda TankNr
pha ; store TankNr pha ; store TankNr
@@ -1972,13 +1938,18 @@ BouncyCastle
sta ShieldEnergy,x sta ShieldEnergy,x
sta xtraj ; prepare coordinates sta xtraj ; prepare coordinates
sta ytraj sta ytraj
sta xtraj+2 ; sta xtraj+2
sta ytraj+2 ; sta ytraj+2
sta Erase sta Erase
jsr DrawTankNr ; draw tank without shield jsr DrawTankNr ; draw tank without shield
ldx TankNr ; restore X value :) ; ldx TankNr ; restore X value :) ... but we don't need X now ..
pla pla
sta TankNr ; restore TankNr value :) sta TankNr ; restore TankNr value :)
sec
lda #180
sbc LeapFrogAngle
sta Angle ; swap angle (LeapFrogAngle - because we have strored angle in this variable)
lsrw Force ; Force = Force / 2 - because earlier we multiplied by 2
mwa XHit xtraj+1 mwa XHit xtraj+1
sbw YHit #5 ytraj+1 sbw YHit #5 ytraj+1
mva #1 color mva #1 color
@@ -2331,14 +2302,8 @@ MIRValreadyAll
jsr DisplayOffensiveTextNr jsr DisplayOffensiveTextNr
; temporary removing tanks from the screen (otherwise they will fall down with soil) ; temporary removing tanks from the screen (otherwise they will fall down with soil)
mva TankNr tempor2
mva #1 Erase
jsr drawtanks
mva tempor2 TankNr
mva #0 Erase
jsr SoilDown2 jsr SoilDown2
mva #$ff HitFlag ; but why ?? mva #$ff HitFlag ; but why ??
;jsr drawtanks
rts rts
.endp .endp
; ------------------------------------------------- ; -------------------------------------------------
@@ -2460,8 +2425,7 @@ NextLine2
ldx TankNr ldx TankNr
sta ActiveDefenceWeapon,x ; deactivate Nuclear Winter sta ActiveDefenceWeapon,x ; deactivate Nuclear Winter
jsr SetFullScreenSoilRange jsr SetFullScreenSoilRange
jsr SoilDown2 jsr SoilDown2.NoClearTanks
jsr drawtanks ; for restore PM
rts rts
; in order to optimize the fragment repeated in both internal loops ; in order to optimize the fragment repeated in both internal loops
@@ -2572,11 +2536,7 @@ ReachSky
adc #0 adc #0
sta RangeRight+1 sta RangeRight+1
; hide tanks and ... ; hide tanks and ...
mva #1 Erase
jsr DrawTanks
jsr SoilDown2 jsr SoilDown2
mva #0 Erase
jsr DrawTanks
ldx TankNr ldx TankNr
; check keyboard/joy and move tank left/right - code copied from BeforeFire ; check keyboard/joy and move tank left/right - code copied from BeforeFire
@@ -2663,10 +2623,10 @@ pressedRight
jsr DrawTankNr jsr DrawTankNr
mva #0 Erase mva #0 Erase
lda XtankstableH,x lda XtankstableH,x
cmp #>(screenwidth-12) ; tank width correction +4 cmp #>(screenwidth-TankWidth-4) ; tank width correction +4
bne @+ bne @+
lda XtankstableL,x lda XtankstableL,x
cmp #<(screenwidth-12) ; tank width correction +4 pixels cmp #<(screenwidth-TankWidth-4) ; tank width correction +4 pixels
@ bcs RightScreenEdge @ bcs RightScreenEdge
inc XtankstableL,x inc XtankstableL,x
sne:inc XtankstableH,x sne:inc XtankstableH,x
@@ -2726,10 +2686,10 @@ pressedSpace
; left or right from center of screen ? ; left or right from center of screen ?
ldy #0 ldy #0
lda XtankstableH,x lda XtankstableH,x
cmp #>((screenwidth/2)-8) cmp #>((screenwidth/2)-TankWidth)
bne @+ bne @+
lda XtankstableL,x lda XtankstableL,x
cmp #<((screenwidth/2)-8) cmp #<((screenwidth/2)-TankWidth)
@ bcc TankOnLeftSide @ bcc TankOnLeftSide
TankOnRightSide TankOnRightSide
dey dey
@@ -2868,11 +2828,7 @@ OnGround
adc #0 adc #0
sta RangeRight+1 sta RangeRight+1
; hide tanks and ... ; hide tanks and ...
mva #1 Erase
jsr DrawTanks
jsr SoilDown2 jsr SoilDown2
mva #0 Erase
jsr DrawTanks
ldx TankNr ldx TankNr
rts rts
.endp .endp
@@ -2909,11 +2865,13 @@ CheckCollisionWithTankLoop
lda xtankstableL,x lda xtankstableL,x
cmp xdraw cmp xdraw
@ @
bcs LeftFromTheTank ;add 8 double byte bcs LeftFromTheTank
; add 8 double byte
; now we use Y as low byte and A as high byte of checked position (right edge of tank) ; now we use Y as low byte and A as high byte of checked position (right edge of tank)
; it is tricky but fast and much shorter ; it is tricky but fast and much shorter
clc clc
adc #8 lda xtankstableL,x
adc #TankWidth
tay tay
lda xtankstableH,x lda xtankstableH,x
adc #0 adc #0
@@ -2954,7 +2912,7 @@ CheckCollisionWithShieldedTank
bcs LeftFromTheTank bcs LeftFromTheTank
tya ;add 16 double byte tya ;add 16 double byte
clc clc
adc #16 adc #TankWidth+4+4
tay tay
lda xtankstableH,x lda xtankstableH,x
adc #0 adc #0