Difference between revisions of "Spinning gun"

From Wiki of ZZT
Jump to navigation Jump to search
m (Byte)
(Formatting, add link, add an elaboration on character to the infobox)
 
Line 2: Line 2:
 
|zzt-oop name=spinninggun
 
|zzt-oop name=spinninggun
 
|id={{Byte|39}}
 
|id={{Byte|39}}
|char={{CharSwatch|24}}
+
|char=animates using the arrow characters {{CharSwatch|24}} through {{CharSwatch|27}}, rotating clockwise
 
|category=creature
 
|category=creature
 
|stats=yes
 
|stats=yes
Line 15: Line 15:
 
The '''spinning gun''' is a built-in creature in ZZT that acts as an indestructible turret. It can configured to shoot either [[bullet|bullets]] or [[star|stars]].
 
The '''spinning gun''' is a built-in creature in ZZT that acts as an indestructible turret. It can configured to shoot either [[bullet|bullets]] or [[star|stars]].
  
The chance of a Spinning Gun shooting on a given tick is <code>P2/9</code>, where <code>P2</code> is <code>Firing Rate - 1</code>.
+
The chance of a spinning gun shooting on a given [[tick]] is <code>P2/9</code>, where <code>P2</code> is <code>Firing Rate - 1</code>.
  
The direction that the Spinning Gun shoots is determined semi-randomly depending on the gun's intelligence and the [[player|player's]] position. The chance of the gun firing intelligently on a given tick is <code>P1/9</code>, where <code>P1</code> is <code>Intelligence - 1</code>. If it chooses to fire intelligently, it will fire vertically if the player is within 2 tiles on the x axis and the gun is not blocked vertically. Otherwise, it will shoot horizontally if the player is within two tiles on the y axis. If neither condition is met, it will not make an intelligent shot. If the Spinning Gun decides to make a non-intelligent shot instead, then it will randomly fire in one of the [[cardinal directions]].
+
The direction that the spinning gun shoots is determined semi-randomly depending on the gun's intelligence and the [[player|player's]] position. The chance of the gun firing intelligently on a given tick is <code>P1/9</code>, where <code>P1</code> is <code>Intelligence - 1</code>. If it chooses to fire intelligently, it will fire vertically if the player is within 2 tiles on the x axis and the gun is not blocked vertically. Otherwise, it will shoot horizontally if the player is within two tiles on the y axis. If neither condition is met, it will not make an intelligent shot. If the spinning gun decides to make a non-intelligent shot instead, then it will randomly fire in one of the [[cardinal directions]].
  
The Spinning Gun cycles between {{CharSwatch|24}}, {{CharSwatch|26}}, {{CharSwatch|25}}, and {{CharSwatch|27}}, however the direction it fires is completely unrelated to the direction it is visibly pointing.
+
The spinning gun cycles between {{CharSwatch|24}}, {{CharSwatch|26}}, {{CharSwatch|25}}, and {{CharSwatch|27}}, however the direction it fires is completely unrelated to the direction it is visibly pointing.
  
 
[[Category:Elements]]
 
[[Category:Elements]]
 
{{ElementsNavbox}}
 
{{ElementsNavbox}}

Latest revision as of 05:28, 14 February 2021

Spinning gun
ZZT-OOP namespinninggun
Internal ID39 (0x27)
Characteranimates using the arrow characters #char 24 (0x18) through #char 27 (0x1B), rotating clockwise
Categorycreature
Stats
Default cycle2
P1intelligence
P2firing rate/type
Other traits
Effect on movementwall
Destructible?no
Uses ZZT-OOP color names?yes

The spinning gun is a built-in creature in ZZT that acts as an indestructible turret. It can configured to shoot either bullets or stars.

The chance of a spinning gun shooting on a given tick is P2/9, where P2 is Firing Rate - 1.

The direction that the spinning gun shoots is determined semi-randomly depending on the gun's intelligence and the player's position. The chance of the gun firing intelligently on a given tick is P1/9, where P1 is Intelligence - 1. If it chooses to fire intelligently, it will fire vertically if the player is within 2 tiles on the x axis and the gun is not blocked vertically. Otherwise, it will shoot horizontally if the player is within two tiles on the y axis. If neither condition is met, it will not make an intelligent shot. If the spinning gun decides to make a non-intelligent shot instead, then it will randomly fire in one of the cardinal directions.

The spinning gun cycles between #char 24 (0x18), #char 26 (0x1A), #char 25 (0x19), and #char 27 (0x1B), however the direction it fires is completely unrelated to the direction it is visibly pointing.