diff --git a/MANUAL_EN.md b/MANUAL_EN.md index 137a0ab..240b039 100644 --- a/MANUAL_EN.md +++ b/MANUAL_EN.md @@ -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. * [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 -- Tanks have energy (and Ogres have layers - like an onion) - 99 units at the start of a round. -- 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 earning money!). +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: -### 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! - -`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 :) ) +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 :) ) Specifically: ### 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. +### 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` - -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`). +Each weapon that results in an explosion has its own blast radius. 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: -`EnergyDecrease = ExplosionRadius * 8` -and with each pixel farther from the center, 8 fewer units are lost. +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). +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. -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. - -And here are the `ExplosionRadius` values for each weapon: - -| Weapon | `ExplosionRadius` | +| Offensive weapons | maximum energy loss | | --- | --- | -| Baby Missile | 11 | -| Missile | 17 | -| Baby Nuke | 25 | -| Nuke | 30 | -| LeapFrog| 17 15 13 | -| Funky Bomb | 21 11 (* 5) | -| MIRV | 17 (* 5) | -| Death's Head | 30 (* 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) | -| Hot Napalm | x 80 (the same principle as in Napalm) | -| Baby Roller | 11 | -| Roller | 21 | -| Heavy Roller | 30 | -| Riot Charge | 31 | -| 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 Bomb | 17 | -| Heavy Riot Bomb | 29 | -| Baby Digger | 0 (60 - as in Riot Blast) | -| Digger | 0 (60 - as above) | -| Heavy Digger | 0 (60 - as above) | -| Baby Sandhog | 0 (60 - as above) | -| Sandhog | 0 (60 - as above) | -| Heavy Sandhog | 0 (60 - as above) | -| Dirt Clod | 12 | -| Dirt Ball | 22 | -| Ton of Dirt | 31 | -| Liquid Dirt | 0 (maybe it's worth changing?) | -| 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, 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).| +| Baby Missile | 88 | +| Missile | 136 | +| Baby Nuke | 200 | +| Nuke | 240 | +| LeapFrog| 136 120 104 | +| Funky Bomb | 168 88 (* 5) | +| MIRV | 136 (* 5) | +| Death's Head | 240 (* 5) | +| 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 | 80 (the rule is the same as in Napalm) | +| Baby Roller | 88 | +| Roller | 168 | +| Heavy Roller | 240 | +| 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 (as in Dirt Charge, but in a radius of 61 pixels) | +| 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 | 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 (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 (as above - greater undermining) | +| Heavy Digger | 0 (as above - greatest undermining) | +| Baby Sandhog | (as above - another way of undermining) | +| Sandhog | 0 (as above - larger dig) | +| Heavy Sandhog | 0 (as above - largest dig) | +| 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 | 0 (as above, but the radius of the ball is 22 pixels) | +| Ton of Dirt | 0 (as above, but the radius of the ball is 31 pixels) | +| Liquid Dirt | 0 (floods the ground at the point of hit with liquid soil, filling in the depressions) | +| 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) | -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. - -Only these big points determine the order in the summary. +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 ## 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. -** **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. -** **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**. @@ -241,9 +225,9 @@ Table of weapons purchased by: **Spoiler** and **Cyborg**. | Offensive weapons | Defensive weapons | | --- | --- | -| Baby Nuke | Battery | -| Nuke | Strong Parachute | -| Death's Head | Mag Deflector | +| Missile | Battery | +| Baby Nuke | Strong Parachute | +| Nuke | Mag Deflector | | Hot Napalm | Heavy Shield | | | Force Shield | | | Bouncy Castle | diff --git a/MANUAL_PL.md b/MANUAL_PL.md index e66fe67..30ffe7f 100644 --- a/MANUAL_PL.md +++ b/MANUAL_PL.md @@ -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. * [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: - -### Najpierw co wiemy o energii czołgów -- Czołgi mają energię (a Ogry warstwy - jak cebula) - na starcie 99 jednostek +### Energia czołgów +- Na początku każdej rundy każdy czołg ma 99 jesnostek energii. - Energii czołgom ubywa na 3 sposoby: * jedna jednostka po oddaniu każdego strzału * 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: ### 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` @@ -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. -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. -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ę. -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: -`EnergyDecrease = ExplosionRadius * 8` +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). +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 :) - -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` | +| Broń ofensywna | maksymalna wartość ubytku energii | | --- | --- | -| Baby Missile | 11 | -| Missile | 17 | -| Baby Nuke | 25 | -| Nuke | 30 | -| LeapFrog| 17 15 13 | -| Funky Bomb | 21 11 (* 5) | -| MIRV | 17 (* 5) | -| Death's Head | 30 (* 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) | -| Hot Napalm | x 80 (zasada taka jak w Napalm) | -| Baby Roller | 11 | -| Roller | 21 | -| Heavy Roller | 30 | -| Riot Charge | 31 | -| 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 Bomb | 17 | -| Heavy Riot Bomb | 29 | -| Baby Digger | 0 (60 - jak w Riot Blast) | -| Digger | 0 (60 - jak wyżej) | -| Heavy Digger | 0 (60 - jak wyżej) | -| Baby Sandhog | 0 (60 - jak wyżej) | -| Sandhog | 0 (60 - jak wyżej) | -| Heavy Sandhog | 0 (60 - jak wyżej) | -| Dirt Clod | 12 | -| Dirt Ball | 22 | -| Ton of Dirt | 31 | -| Liquid Dirt | 0 (może warto to zmienić?) | -| Dirt Charge | 0 (61 - jak wyżej) | -| 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).| +| Baby Missile | 88 | +| Missile | 136 | +| Baby Nuke | 200 | +| Nuke | 240 | +| LeapFrog| 136 120 104 | +| Funky Bomb | 168 88 (* 5) | +| MIRV | 136 (* 5) | +| Death's Head | 240 (* 5) | +| 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 | 80 (zasada taka jak w Napalm) | +| Baby Roller | 88 | +| Roller | 168 | +| Heavy Roller | 240 | +| 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 (jak w Dirt Charge, tyle że w promieniu 61 pikseli) | +| 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 | 0 (jak w Riot Bomb, ale promień eksplozji to 29 pikseli od punktu trafienia - tak jak w wypadku Nuke) | +| Baby Digger | 0 (nie jest odejmowana energia, ale podkopywana jest część gruntu promieniu 60 pikseli od punktu trafienia) | +| Digger | 0 (jak wyżej - większy podkop) | +| Heavy Digger | 0 (jak wyżej - największy podkop) | +| Baby Sandhog | 0 (jak wyżej - inny sposób podkopywania) | +| Sandhog | 0 (jak wyżej - większy podkop) | +| Heavy Sandhog | 0 (jak wyżej - największy podkop) | +| 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 | 0 (jak wyżej, ale promień kuli to 22 piksele) | +| Ton of Dirt | 0 (jak wyżej, ale promień kuli to 31 pikseli) | +| Liquid Dirt | 0 (zalewa grunt w punkcie trafienia płynną glebą wypełniając zagłębienia) | +| 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 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. 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. -* **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. -* **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** @@ -236,9 +226,9 @@ Tabela broni kupowanych przez: **Spoiler** i **Cyborg** | bronie ofensywne | bronie defensywne | | --- | --- | -| Baby Nuke | Battery | -| Nuke | Strong Parachute | -| Death's Head | Mag Deflector | +| Missile | Battery | +| Baby Nuke | Strong Parachute | +| Nuke | Mag Deflector | | Hot Napalm | Heavy Shield | | | Force Shield | | | Bouncy Castle | diff --git a/README.md b/README.md index 9c285a7..b4ec733 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,21 @@ With the advent of [fujinet](https://fujinet.online/) we are thinking about maki ## 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 2022-08-30 diff --git a/ai.asm b/ai.asm index ab9e339..2006d6c 100644 --- a/ai.asm +++ b/ai.asm @@ -8,26 +8,6 @@ ; - shoots random direction and force ; 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 ; @@ -43,6 +23,25 @@ loop lda AIRoutines,y 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 ; address of weapons table (for future use) lda TanksWeaponsTableL,x @@ -155,13 +154,7 @@ endo ; choose the best weapon - ldy #last_offensive_____ ;the last weapon -loop - dey - lda (temp),y ; this is set up before calling the routine, has address of TanksWeaponsTable - beq loop - tya - sta ActiveWeapon,x + jsr ChooseBestOffensive rts .endp ;---------------------------------------------- @@ -207,17 +200,7 @@ endo ; choose the best weapon - lda TanksWeaponsTableL,x - 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 + jsr ChooseBestOffensive rts ;---------------------------------------------- @@ -331,17 +314,7 @@ NoUseDefensive jsr TakeAim ; direction still in A (0 - left, >0 - right) ; choose the best weapon - lda TanksWeaponsTableL,x - 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 + jsr ChooseBestOffensive ; randomizing force +-100 sbw Force #100 RandBoundaryLow @@ -350,9 +323,10 @@ loop NotNegativeEnergy adw Force #100 RandBoundaryHigh jsr RandomizeForce - lda ForceTableH,x - bne HighForce - ; if Force lower than 256 - set weapon to Baby Missile (for security :) ) + ; if target distance lower than 24 - set weapon to Baby Missile (for security :) + jsr GetDistance + cmp #6 ; 24/4 + bcs HighForce lda #ind_Baby_Missile___ sta ActiveWeapon,x HighForce @@ -372,17 +346,7 @@ HighForce jsr TakeAim ; direction still in A (0 - left, >0 - right) ; choose the best weapon - lda TanksWeaponsTableL,x - 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 + jsr ChooseBestOffensive ; randomizing force +-50 sbw Force #50 RandBoundaryLow @@ -391,9 +355,10 @@ loop NotNegativeEnergy adw Force #50 RandBoundaryHigh jsr RandomizeForce - lda ForceTableH,x - bne HighForce - ; if Force lower than 256 - set weapon to Baby Missile (for security :) ) + ; if target distance lower than 24 - set weapon to Baby Missile (for security :) + jsr GetDistance + cmp #6 ; 24/4 + bcs HighForce lda #ind_Baby_Missile___ sta ActiveWeapon,x HighForce @@ -412,24 +377,17 @@ HighForce jsr TakeAim ; direction still in A (0 - left, >0 - right) ; choose the best weapon - lda TanksWeaponsTableL,x - 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 + ldy #ind_Nuke___________+1 + jsr ChooseBestOffensive.NotFromAll lda Force sta ForceTableL,x lda Force+1 sta ForceTableH,x - bne HighForce - ; if Force lower than 256 - set weapon to Baby Missile (for security :) ) + ; if target distance lower than 32 - set weapon to Baby Missile (for security :) + jsr GetDistance + cmp #8 ;32/4 + bcs HighForce lda #ind_Baby_Missile___ sta ActiveWeapon,x HighForce @@ -445,7 +403,7 @@ HighForce ; direcion of shoot in A (0 - left, >0 - right) ;---------------------------------------------- sta PreferHumansFlag - jsr MakeLowResDistances +; jsr MakeLowResDistances lda #202 sta temp2 ; max possible energy lda #0 @@ -497,7 +455,7 @@ skipThisPlayer ; returns target tank number in Y and ; direcion of shoot in A (0 - left, >0 - right) ;---------------------------------------------- - jsr MakeLowResDistances +; jsr MakeLowResDistances mva #$ff temp2 ; min possible distance mva #0 tempor2 ; direction of shoot @@ -1052,3 +1010,41 @@ SorryNoPurchase rts .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 \ No newline at end of file diff --git a/constants.asm b/constants.asm index 7a4dd52..2f55d79 100644 --- a/constants.asm +++ b/constants.asm @@ -397,7 +397,7 @@ PurchaseMeTable2 ;weapons good to be purchased by the robot (Cyborg) ;the comment is an index in the tables ; "Baby Missile ","Missile ","Baby Nuke ","Nuke " ; "LeapFrog ","Funky Bomb ","MIRV ","Death's Head " - .by %00110001 + .by %01110000 ; "Napalm ","Hot Napalm ","Tracer ","Smoke Tracer " ; "Baby Roller ","Roller ","Heavy Roller ","Riot Charge " .by %01000000 diff --git a/definitions.asm b/definitions.asm index 0b04e1e..25bb623 100644 --- a/definitions.asm +++ b/definitions.asm @@ -4,6 +4,7 @@ screenheight = 200 screenBytes = 40 screenwidth = screenBytes*8 ; Max screenwidth = 512!!! +TankWidth = 8 ;---------------------------------------------- ; Player/missile memory PMGraph = $0800 ; real PM start = $0b00 diff --git a/display.asm b/display.asm index 817666e..7c4a95e 100644 --- a/display.asm +++ b/display.asm @@ -1,12 +1,9 @@ ; @com.wudsn.ide.asm.mainsourcefile=scorch.asm .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) -; --------------- +;----------------------------------------------- OptionsHere ; 0123456789012345678901234567890123456789 dta d"Players : 2 3 4 5 6 " @@ -105,7 +102,7 @@ DLCreditsAddr .word GameOverDL ;------------------------ ; end of "variables" (RAM) -; --------------- +;------------------------ ; start of "constants" (ROM) ;----------------------------------------------- ;Screen displays go first to avoid crossing 4kb barrier @@ -122,7 +119,6 @@ MoreUp dta d" more " dta 92,92,92 dta d" " - .ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!! MoreDown dta d" " dta 93,93,93 @@ -163,40 +159,6 @@ GameOverTitle2 ;----------------------------------------------------- ;-------------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 .byte 0 @@ -245,6 +207,41 @@ dl ; MAIN game display list .byte $41 .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 Credits = GameOverResults +(6*40) CreditsLastLine = Credits + (CreditsLines*40) diff --git a/grafproc.asm b/grafproc.asm index 2779518..76db853 100644 --- a/grafproc.asm +++ b/grafproc.asm @@ -584,6 +584,11 @@ UnequalTanks .endp ;------------------------------------------------- +.proc ClearTanks + jsr PMoutofScreen + mva #1 Erase ; erase tanks flag +.endp +;-- .proc drawtanks ;------------------------------------------------- lda TankNr @@ -601,6 +606,7 @@ DrawNextTank pla sta TankNr + mva #0 Erase ; no erase tanks flag rts .endp ;--------- @@ -645,7 +651,8 @@ DrawTankNrX jsr SetupXYdraw jsr TypeChar - + lda Erase + jne noTankNoPM ; now P/M graphics on the screen (only for 5 tanks) ; horizontal position ldx TankNr @@ -729,7 +736,7 @@ ZeroesToGo6 bne ClearPM6 NoPlayerMissile - +noTankNoPM ldy #$01 lda Erase beq @+ @@ -1130,10 +1137,10 @@ FallingRight bvs EndRightFall ; we finish falling right if the tank reached the edge of the screen 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 @+ 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 NotRightEdge ; tank is falling right - modify coorinates @@ -1263,20 +1270,37 @@ drawmountainsloop beq NoMountain sta ydraw 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 inw modify inw xdraw cpw xdraw #screenwidth bne drawmountainsloop rts +/* ;-------------------------------------------------- -drawmountainspixel +drawmountainspixel ; never used ? ;-------------------------------------------------- mwa #0 xdraw mwa #mountaintable modify - - drawmountainspixelloop ldy #0 lda (modify),y @@ -1287,8 +1311,8 @@ drawmountainspixelloop inw xdraw cpw xdraw #screenwidth bne drawmountainspixelloop - rts + */ .endp ;-------------------------------------------------- .proc SoilDown2 @@ -1317,8 +1341,8 @@ drawmountainspixelloop ; how it works. I have just translated Polish comment ; but I do not understand a word of it :) ; If you know how it works, please write here :)))) - - jsr PMoutofscreen + jsr ClearTanks +NoClearTanks ; First we look for highest pixels and fill with their coordinates ; both tables @@ -1416,6 +1440,7 @@ ColumnIsReady ; now correct heights are in the mountaintable sta color ; Pozor! :) we know - now A=1 mva #sfx_silencer sfx_effect + jsr DrawTanks rts .endp @@ -1761,31 +1786,8 @@ ClearPlot eor #$ff and bittable,x 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 - -; ------------------------------------------ +;-------------------------------------------------- .proc TypeChar ; puts char on the graphics screen ; in: CharCode diff --git a/scorch.asm b/scorch.asm index bced622..3a70a9f 100644 --- a/scorch.asm +++ b/scorch.asm @@ -36,7 +36,7 @@ ;we decided it must go in 'English' to let other people work on it .macro build - dta d"1.13" ; number of this build (3 bytes) + dta d"1.14" ; number of this build (3 bytes) .endm icl 'definitions.asm' @@ -103,7 +103,7 @@ .zpvar Counter .byte ;temporary Counter for outside loops .zpvar ExplosionRadius .word ;because when adding in xdraw it is double byte .zpvar ResultY .byte - .zpvar FallDown2 .byte +; .zpvar FallDown2 .byte .zpvar xcircle .word .zpvar ycircle .word .zpvar vy .word @@ -171,8 +171,7 @@ WeaponFont ; Game Code ;-------------------------------------------------- FirstSTART - mva #0 dmactls ; dark screen - jsr WaitOneFrame + jsr MakeDarkScreen ; one time zero variables in RAM (non zero page) lda #0 @@ -227,14 +226,12 @@ START jsr Options ;startup screen - mva #0 dmactls ; dark screen - jsr WaitOneFrame + jsr MakeDarkScreen bit escFlag bmi START jsr EnterPlayerNames - mva #0 dmactls ; dark screen - jsr WaitOneFrame + jsr MakeDarkScreen bit escFlag bmi START @@ -255,8 +252,7 @@ SettingBarrel jsr CallPurchaseForEveryTank ; issue #72 (glitches when switches) - mva #0 dmactls ; dark screen - jsr WaitOneFrame + jsr MakeDarkScreen bit escFlag bmi START @@ -275,11 +271,8 @@ SettingBarrel jsr SortSequence ; Hide all (easier than hide last ;) ) tanks - mva #1 Erase - jsr drawtanks - mva #0 Erase + jsr cleartanks sta COLBAKS ; set background color to black - jsr PMoutofScreen ;let P/M disappear ; here gains and losses should be displayed (dollars) ; finally we have changed our minds and money of players @@ -386,14 +379,12 @@ eskipzeroing lda GameIsOver beq NoGameOverYet GoGameOver - mva #0 dmactls ; dark screen - jsr WaitOneFrame + jsr MakeDarkScreen jsr GameOverScreen jmp START NoGameOverYet inc CurrentRoundNr - lda #$0 - sta dmactls ; issue #72 + jsr MakeDarkScreen ; issue #72 jsr RmtSongSelect mva #sfx_silencer sfx_effect jsr PMoutofscreen @@ -642,8 +633,7 @@ ShootNow beq missed lda #0 - sta FallDown1 - sta FallDown2 +; sta FallDown2 jsr Explosion continueMainRoundLoopAfterSeppuku @@ -654,14 +644,7 @@ continueMainRoundLoopAfterSeppuku AfterExplode - ;temporary tanks removal (would fall down with soil) - mva #1 Erase - jsr drawtanks - mva #0 Erase - lda FallDown2 - beq NoFallDown2 - jsr SoilDown2 - + jsr SoilDown2 ; allways NoFallDown2 ;here tanks are falling down mva tankNr tempor2 @@ -811,8 +794,7 @@ NoPlayerNoDeath ;cleanup of the soil fall down ranges (left and right) sta RangeRight sta RangeRight+1 - sta FallDown1 - sta FallDown2 +; sta FallDown2 mwa #screenwidth RangeLeft ; We are randomizing the weapon now. @@ -919,8 +901,7 @@ NotNegativeShieldEnergy ;--------------------------------- .proc Seppuku lda #0 - sta FallDown1 - sta FallDown2 + ;sta FallDown2 sta ydraw+1 ; get position of the tank ldx TankNr @@ -1632,6 +1613,9 @@ peopleAreHere noKey rts .endp +MakeDarkScreen + mva #0 dmactls ; dark screen + ; and wait one frame :) .proc WaitOneFrame lda CONSOL and #%00000101 ; Start + Option diff --git a/scorch.xex b/scorch.xex index 06e314d..1f25853 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index c58b447..f112879 100644 --- a/textproc.asm +++ b/textproc.asm @@ -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) bcc GetRandomDefensive GetRandomOffensive - randomize ind_Missile________ ind_Laser__________ + randomize ind_Missile________ last_offensive_____ cmp #ind_Buy_me_________ beq GetRandomOffensive tay - lda WeaponUnits,y ; check if weapon exist - beq GetRandomOffensive +; lda WeaponUnits,y ; check if weapon exist +; beq GetRandomOffensive bne NoSuprise ; Y always <> 0 GetRandomDefensive - randomize ind_Battery________ ind_Nuclear_Winter_ + randomize ind_Battery________ last_defensive_____ tay - lda WeaponUnits,y ; check if weapon exist - beq GetRandomDefensive +; lda WeaponUnits,y ; check if weapon exist +; beq GetRandomDefensive NoSuprise lda TanksWeaponsTableL,x @@ -1267,7 +1267,7 @@ NotFirstLetter cpy PositionInName bne @+ ora #$80 ; place cursor -@ sta NameAdr,y +@ sta NameAdr,y dey bpl CursorLoop rts @@ -2161,8 +2161,7 @@ FastTank bpl AllTanksFloatingDown jsr IsKeyPressed bne MainTanksFloatingLoop ; neverending loop - mva #0 dmactls ; dark screen - jsr WaitOneFrame + jsr MakeDarkScreen jsr GameOverResultsClear rts RandomizeTankPos diff --git a/variables.asm b/variables.asm index 6573a2a..379ae63 100644 --- a/variables.asm +++ b/variables.asm @@ -315,7 +315,6 @@ decimalresult .DS 5 ;ExplosionRadius .DS 2 ;because when adding in xdraw it is double byte ;round CurrentRoundNr .DS 1 -FallDown1 .DS 1 ;FallDown2 .DS 1 ;leapfrog LeapFrogAngle .DS 1 diff --git a/weapons.asm b/weapons.asm index c7e3313..5fb42cd 100644 --- a/weapons.asm +++ b/weapons.asm @@ -17,6 +17,7 @@ pha lda ExplosionRoutines,x pha +; inc FallDown2 rts ExplosionRoutines .word babymissile-1 ;Baby_Missile___;_00 @@ -61,54 +62,41 @@ tracer ; ------------------------ .proc babymissile mva #sfx_baby_missile sfx_effect - inc FallDown2 +; inc FallDown2 mva #11 ExplosionRadius - jsr CalculateExplosionRange jmp xmissile .endp ; ------------------------ .proc missile ; mva #sfx_baby_missile sfx_effect - inc FallDown2 +; inc FallDown2 mva #17 ExplosionRadius - jsr CalculateExplosionRange jmp xmissile .endp ; ------------------------ .proc babynuke mva #sfx_nuke sfx_effect - inc FallDown2 +; inc FallDown2 mva #25 ExplosionRadius - jsr CalculateExplosionRange jmp xmissile .endp ; ------------------------ .proc nuke mva #sfx_nuke sfx_effect - inc FallDown2 +; inc FallDown2 mva #30 ExplosionRadius - jsr CalculateExplosionRange jmp xmissile .endp ; ------------------------ .proc leapfrog mva #sfx_baby_missile sfx_effect - inc FallDown2 +; inc FallDown2 mva #17 ExplosionRadius - jsr CalculateExplosionRange jsr xmissile ; soil must fall down now! there is no other way... ; hide tanks or they fall down with soil - lda TankNr - pha - mva #1 Erase - jsr drawtanks - mva #0 Erase jsr SoilDown2 - jsr drawtanks - pla - sta TankNr ; it looks like force is divided by 4 here BUT" ; in Flight routine force is multiplied by 2 and left @@ -127,19 +115,11 @@ tracer mva #15 ExplosionRadius jsr CalculateExplosionRange0 mva #sfx_baby_missile sfx_effect - jsr xmissile + jsr xmissile.NoRangeCalc ; soil must fall down now! there is no other way... ; hide tanks or they fall down with soil - lda TankNr - pha - mva #1 Erase - jsr drawtanks - mva #0 Erase jsr SoilDown2 - jsr drawtanks - pla - sta TankNr ; it looks like force is divided by 4 here BUT" ; in Flight routine force is multiplied by 2 and left @@ -157,13 +137,13 @@ tracer mva #13 ExplosionRadius jsr CalculateExplosionRange0 mva #sfx_baby_missile sfx_effect - jmp xmissile + jmp xmissile.NoRangeCalc EndOfLeapping rts .endp ; ------------------------ .proc mirv ; the whole mirv is performed by Flight routine - inc FallDown2 +; inc FallDown2 rts .endp ; ------------------------ @@ -171,26 +151,16 @@ EndOfLeapping mva #sfx_baby_missile sfx_effect 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) - inc FallDown2 +; inc FallDown2 ;central Explosion mva #21 ExplosionRadius jsr CalculateExplosionRange0 - jsr xmissile - - lda TankNr - pha - mva #1 Erase - jsr drawtanks - mva #0 Erase + jsr xmissile.NoRangeCalc jsr SoilDown2 ; - mva #1 Erase - jsr drawtanks - mva #0 Erase + jsr cleartanks ; maybe not? sta FunkyWallFlag - pla - sta TankNr mva #1 color mva #5 FunkyBombCounter FunkyBombLoop @@ -211,7 +181,6 @@ FunkyBombLoop mva #sfx_funky_hit sfx_effect jsr Flight - jsr CalculateExplosionRange lda HitFlag beq NoExplosionInFunkyBomb mva #sfx_baby_missile sfx_effect @@ -229,22 +198,18 @@ NoWallsInFunky .endp ; ------------------------ .proc deathshead - inc FallDown2 +; inc FallDown2 mva #30 ExplosionRadius - jsr CalculateExplosionRange - mva #sfx_nuke sfx_effect SaveDrawXY jsr xmissile UnSaveDrawXY sbw xdraw #34 - jsr CalculateExplosionRange mva #sfx_nuke sfx_effect SaveDrawXY jsr xmissile UnSaveDrawXY adw xdraw #68 - jsr CalculateExplosionRange mva #sfx_nuke sfx_effect SaveDrawXY jsr xmissile @@ -285,7 +250,7 @@ NoLowerCircle ; ------------------------ .proc napalm mva #sfx_napalm sfx_effect - inc FallDown2 +; inc FallDown2 mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width) jsr CalculateExplosionRange mva #0 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm @@ -294,7 +259,7 @@ NoLowerCircle ; ------------------------ .proc hotnapalm mva #sfx_napalm sfx_effect - inc FallDown2 +; inc FallDown2 mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width) jsr CalculateExplosionRange mva #1 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm @@ -359,7 +324,7 @@ CharOffTheScreen dec magic jpl RepeatNapalm ; after napalm - inc FallDown2 +; inc FallDown2 ;now we must check tanks in range ldx NumberOfPlayers dex @@ -378,7 +343,7 @@ BurnedCheckLoop @ bcs TankOutOfFire ; 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 @+ mwa #0 xdraw ; left screen edge @ @@ -407,32 +372,32 @@ EndNurnedCheckLoop .endp ; ------------------------ .proc babyroller - inc FallDown2 +; inc FallDown2 mva #11 ExplosionRadius jmp xroller .endp ; ------------------------ .proc roller ; - inc FallDown2 +; inc FallDown2 mva #21 ExplosionRadius jmp xroller .endp ; ------------------------ .proc heavyroller - inc FallDown2 +; inc FallDown2 mva #30 ExplosionRadius jmp xroller .endp ; ------------------------ .proc riotbomb - inc FallDown2 +; inc FallDown2 mva #17 ExplosionRadius jsr CalculateExplosionRange jmp xriotbomb .endp ; ------------------------ .proc heavyriotbomb - inc FallDown2 +; inc FallDown2 mva #29 ExplosionRadius jsr CalculateExplosionRange jmp xriotbomb @@ -441,7 +406,7 @@ EndNurnedCheckLoop .proc babydigger mva #sfx_digger sfx_effect mva #0 sandhogflag - inc FallDown2 +; inc FallDown2 mva #13 DigLong mva #1 diggery ; how many branches (-1) jmp xdigger @@ -450,7 +415,7 @@ EndNurnedCheckLoop .proc digger ; mva #sfx_digger sfx_effect mva #0 sandhogflag - inc FallDown2 +; inc FallDown2 mva #13 DigLong mva #3 diggery ; how many branches (-1) jmp xdigger @@ -459,7 +424,7 @@ EndNurnedCheckLoop .proc heavydigger mva #sfx_digger sfx_effect mva #0 sandhogflag - inc FallDown2 +; inc FallDown2 mva #13 DigLong mva #7 diggery ; how many branches (-1) jmp xdigger @@ -583,7 +548,7 @@ DiggerCharacter .proc babysandhog mva #sfx_sandhog sfx_effect mva #char_sandhog_offset sandhogflag - inc FallDown2 +; inc FallDown2 mva #13 DigLong mva #1 diggery ; how many branches (-1) jmp xdigger @@ -592,7 +557,7 @@ DiggerCharacter .proc sandhog mva #sfx_sandhog sfx_effect mva #char_sandhog_offset sandhogflag - inc FallDown2 +; inc FallDown2 mva #13 DigLong mva #3 diggery ; how many branches (-1) jmp xdigger @@ -601,35 +566,35 @@ DiggerCharacter .proc heavysandhog mva #sfx_sandhog sfx_effect mva #char_sandhog_offset sandhogflag - inc FallDown2 +; inc FallDown2 mva #13 DigLong mva #5 diggery ; how many branches (-1) jmp xdigger .endp ; ------------------------ .proc dirtclod - inc FallDown2 +; inc FallDown2 mva #12 ExplosionRadius jsr CalculateExplosionRange jmp xdirt .endp ; ------------------------ .proc dirtball - inc FallDown2 +; inc FallDown2 mva #22 ExplosionRadius jsr CalculateExplosionRange jmp xdirt .endp ; ------------------------ .proc tonofdirt - inc FallDown2 +; inc FallDown2 mva #31 ExplosionRadius jsr CalculateExplosionRange jmp xdirt .endp ; ------------------------ .proc dirtcharge - inc FallDown2 +; inc FallDown2 mva #61 ExplosionRadius jsr CalculateExplosionRange jmp ofdirt @@ -637,7 +602,7 @@ DiggerCharacter ; ------------------------ .proc riotcharge mva #sfx_riot_blast sfx_effect - inc FallDown2 +; inc FallDown2 mva #31 ExplosionRadius jsr CalculateExplosionRange jmp cleanDirt @@ -645,7 +610,7 @@ DiggerCharacter ; ------------------------ .proc riotblast mva #sfx_riot_blast sfx_effect - inc FallDown2 +; inc FallDown2 mva #61 ExplosionRadius jsr CalculateExplosionRange jmp cleanDirt @@ -719,6 +684,8 @@ LaserMisses ; ----------------- .proc xmissile ; ; ----------------- + jsr CalculateExplosionRange +NoRangeCalc lda #1 sta radius sta color @@ -930,7 +897,6 @@ ExplodeNow mwa ycircle ydraw ;(bad) ; finally a little explosion - jsr CalculateExplosionRange mva #sfx_baby_missile sfx_effect jmp xmissile rts @@ -1135,7 +1101,6 @@ ToHighFill ;first, get current parameters (angle+force) ;for an active tank and display them ;(these values are taken from the previous round) - mva #0 Erase ldx TankNr @@ -1152,6 +1117,7 @@ ContinueToCheckMaxForce2 lda MaxForceTableL,x sta ForceTableL,x @ + mva #0 Erase jsr DisplayStatus ;all digital values like force, angle, wind, etc. jsr PutTankNameOnScreen @@ -1211,9 +1177,7 @@ QuitToGameover bne @+ callActivation ; Hide all tanks - after inventory they may have other shapes - mva #1 Erase - jsr DrawTanks - mva #0 Erase + jsr ClearTanks jsr DefensivesActivate jmp afterInventory @@ -1222,15 +1186,12 @@ callActivation bne @+ callInventory ; Hide all tanks - after inventory they may have other shapes - mva #1 Erase - jsr DrawTanks - mva #0 Erase + jsr ClearTanks ; mva #$ff isInventory jsr Purchase afterInventory - mva #0 dmactls ; dark screen - jsr WaitOneFrame + jsr MakeDarkScreen lda #song_ingame jsr RmtSongSelect mva #0 escFlag @@ -1905,12 +1866,19 @@ EndOfFlight2 @ ; tank hit - check defensive weapon of this tank 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 cmp #ind_Bouncy_Castle__ ; Auto Defence jeq BouncyCastle cmp #ind_Mag_Deflector__ ; Mag Deflector beq MagDeflector +JNoDefence jmp NoDefence MagDeflector ; now run defensive-aggressive weapon - Mag Deflector! @@ -1960,8 +1928,6 @@ NoDefence BouncyCastle mva #sfx_shield_on sfx_effect ; 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 lda TankNr pha ; store TankNr @@ -1972,13 +1938,18 @@ BouncyCastle sta ShieldEnergy,x sta xtraj ; prepare coordinates sta ytraj - sta xtraj+2 - sta ytraj+2 +; sta xtraj+2 +; sta ytraj+2 sta Erase jsr DrawTankNr ; draw tank without shield - ldx TankNr ; restore X value :) +; ldx TankNr ; restore X value :) ... but we don't need X now .. pla 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 sbw YHit #5 ytraj+1 mva #1 color @@ -2331,14 +2302,8 @@ MIRValreadyAll jsr DisplayOffensiveTextNr ; 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 mva #$ff HitFlag ; but why ?? - ;jsr drawtanks rts .endp ; ------------------------------------------------- @@ -2460,8 +2425,7 @@ NextLine2 ldx TankNr sta ActiveDefenceWeapon,x ; deactivate Nuclear Winter jsr SetFullScreenSoilRange - jsr SoilDown2 - jsr drawtanks ; for restore PM + jsr SoilDown2.NoClearTanks rts ; in order to optimize the fragment repeated in both internal loops @@ -2572,11 +2536,7 @@ ReachSky adc #0 sta RangeRight+1 ; hide tanks and ... - mva #1 Erase - jsr DrawTanks jsr SoilDown2 - mva #0 Erase - jsr DrawTanks ldx TankNr ; check keyboard/joy and move tank left/right - code copied from BeforeFire @@ -2663,10 +2623,10 @@ pressedRight jsr DrawTankNr mva #0 Erase lda XtankstableH,x - cmp #>(screenwidth-12) ; tank width correction +4 + cmp #>(screenwidth-TankWidth-4) ; tank width correction +4 bne @+ lda XtankstableL,x - cmp #<(screenwidth-12) ; tank width correction +4 pixels + cmp #<(screenwidth-TankWidth-4) ; tank width correction +4 pixels @ bcs RightScreenEdge inc XtankstableL,x sne:inc XtankstableH,x @@ -2726,10 +2686,10 @@ pressedSpace ; left or right from center of screen ? ldy #0 lda XtankstableH,x - cmp #>((screenwidth/2)-8) + cmp #>((screenwidth/2)-TankWidth) bne @+ lda XtankstableL,x - cmp #<((screenwidth/2)-8) + cmp #<((screenwidth/2)-TankWidth) @ bcc TankOnLeftSide TankOnRightSide dey @@ -2868,11 +2828,7 @@ OnGround adc #0 sta RangeRight+1 ; hide tanks and ... - mva #1 Erase - jsr DrawTanks jsr SoilDown2 - mva #0 Erase - jsr DrawTanks ldx TankNr rts .endp @@ -2909,11 +2865,13 @@ CheckCollisionWithTankLoop lda xtankstableL,x 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) ; it is tricky but fast and much shorter clc - adc #8 + lda xtankstableL,x + adc #TankWidth tay lda xtankstableH,x adc #0 @@ -2954,7 +2912,7 @@ CheckCollisionWithShieldedTank bcs LeftFromTheTank tya ;add 16 double byte clc - adc #16 + adc #TankWidth+4+4 tay lda xtankstableH,x adc #0