Difference between revisions of "CWorm"

From Project X Wiki
Jump to: navigation, search
Line 40: Line 40:
 
  };
 
  };
  
TurnSide: Reflects wich side the worm is oriented. -1 for left, 1 for right.
+
TurnSide: Reflects wich side the worm is oriented. -1 for left, 1 for right. DONT USE WITH this-> , it becomes buggy. Instead of this use CWorm(Root->GetObject(2, 16 * WormTeam + WormNum)).
  
 
WormTeam: Worm team number (1-6).
 
WormTeam: Worm team number (1-6).

Revision as of 18:30, 30 September 2013

Up one category:
Scripting


Worms Armageddon class
Wormimage.png
Class name: CWorm
Description: Describes a worm
Constructor: CWorm::CWorm(CObject* Parent, int aTeam, int aIndex, CWormParams* params);
Derived From: CGObject


Describes a worm.

Fields

class CWorm : CGObject
{
    int       WormTeam;
    int       WormNumber;
    int       SomeControlBased;
    int       LabelColor;
    int       KnockedOut;  
    int       WeaponN; 
    fixed     DispHealth; 
    fixed     TargHealth; 
    int       ShowHealthChgLbl; 
    int       GotDamage;
    int       TurnSide;
    int       PressedUp; 
    int       PressedDown; 
    int       PressedLeft; 
    int       PressedRight; 
    int       JetFuel;  
    fixed     FirePower;    
    fixed     FireAngle; 
    int       nTotalShoots;  
    int       nAvalShoots; 
    bool      CanFire; 
    int       nShooted;
    int       nShoots;
    int       TimeToFire;
    int       WeapLatency; 
    int       SelectX; 
    int       SelectY; 
    int       AnimHelper; 
    CWeapon*  CurWeapon;
};

TurnSide: Reflects wich side the worm is oriented. -1 for left, 1 for right. DONT USE WITH this-> , it becomes buggy. Instead of this use CWorm(Root->GetObject(2, 16 * WormTeam + WormNum)).

WormTeam: Worm team number (1-6).

WormNumber: Worm number relative to the team (1-8).

WeaponN: Currently selected weapon number in table?

DispHealth: Displayed worm available health.

GotDamage: Displayed amount of damage worm has received. (Appears above worm. After damage was shown it sets back to 0)

JetFuel: Jetpack fuel?

FirePower: Weapon fire power.

FireAngle: Weapon fire angle (0.0 - 1.0).

CanFire: Reflects whether the worm is allowed to shoot. After shot was made it sets to false. Changing it to true after that allows worm to make second shot.

SelectX: The X coordinate of the last cursor click (homing weapons, teleport, girder, etc...), currently multiplied by 65536, divide it by 65536 to get the number of pixels. This value is read by homing (clickable) weapons when they perform the action. If no click was done at all, the SelectX will be on half of the map's X size.

SelectY: The Y coordinate of the last cursor click (homing weapons, teleport, girder, etc...), currently multiplied by 65536, divide it by 65536 to get the number of pixels. This value is read by homing (clickable) weapons when they perform the action. If no click was done at all, the SelectY will be on half of the map's Y size.

CurWeapon: Pointer to currently selected weapon.