2016-10-13 18:45:52 +00:00
|
|
|
class PlayerPawn : Actor native
|
|
|
|
{
|
2016-11-22 22:42:32 +00:00
|
|
|
|
|
|
|
native int crouchsprite;
|
|
|
|
native int MaxHealth;
|
2017-03-02 10:39:52 +00:00
|
|
|
native int BonusHealth;
|
2016-11-22 22:42:32 +00:00
|
|
|
native int MugShotMaxHealth;
|
|
|
|
native int RunHealth;
|
|
|
|
native int PlayerFlags;
|
2017-03-21 19:09:09 +00:00
|
|
|
native clearscope Inventory InvFirst; // first inventory item displayed on inventory bar
|
|
|
|
native clearscope Inventory InvSel; // selected inventory item
|
2017-02-28 00:23:12 +00:00
|
|
|
native Name SoundClass; // Sound class
|
|
|
|
native Name Face; // Doom status bar face (when used)
|
|
|
|
native Name Portrait;
|
|
|
|
native Name Slot[10];
|
|
|
|
native double HexenArmor[5];
|
|
|
|
native uint8 ColorRangeStart; // Skin color range
|
|
|
|
native uint8 ColorRangeEnd;
|
2017-02-08 15:42:13 +00:00
|
|
|
|
2016-11-22 22:42:32 +00:00
|
|
|
// [GRB] Player class properties
|
|
|
|
native double JumpZ;
|
|
|
|
native double GruntSpeed;
|
|
|
|
native double FallingScreamMinSpeed, FallingScreamMaxSpeed;
|
|
|
|
native double ViewHeight;
|
|
|
|
native double ForwardMove1, ForwardMove2;
|
|
|
|
native double SideMove1, SideMove2;
|
|
|
|
native TextureID ScoreIcon;
|
|
|
|
native int SpawnMask;
|
|
|
|
native Name MorphWeapon;
|
|
|
|
native double AttackZOffset; // attack height, relative to player center
|
|
|
|
native double UseRange; // [NS] Distance at which player can +use
|
|
|
|
native double AirCapacity; // Multiplier for air supply underwater.
|
|
|
|
native Class<Actor> FlechetteType;
|
|
|
|
native color DamageFade; // [CW] Fades for when you are being damaged.
|
|
|
|
native double ViewBob; // [SP] ViewBob Multiplier
|
2017-01-23 23:12:06 +00:00
|
|
|
native double FullHeight;
|
2017-02-28 00:23:12 +00:00
|
|
|
|
|
|
|
meta Name HealingRadiusType;
|
|
|
|
meta Name InvulMode;
|
|
|
|
|
2017-03-19 10:35:24 +00:00
|
|
|
property prefix: Player;
|
|
|
|
property HealRadiusType: HealingradiusType;
|
|
|
|
property InvulnerabilityMode: InvulMode;
|
|
|
|
property AttackZOffset: AttackZOffset;
|
|
|
|
property JumpZ: JumpZ;
|
|
|
|
property GruntSpeed: GruntSpeed;
|
|
|
|
property FallingScreamSpeed: FallingScreamMinSpeed, FallingScreamMaxSpeed;
|
|
|
|
property ViewHeight: ViewHeight;
|
|
|
|
property UseRange: UseRange;
|
|
|
|
property AirCapacity: AirCapacity;
|
|
|
|
property MaxHealth: MaxHealth;
|
|
|
|
property MugshotMaxHealth: MugshotMaxHealth;
|
|
|
|
property RunHealth: RunHealth;
|
|
|
|
property MorphWeapon: MorphWeapon;
|
|
|
|
property FlechetteType: FlechetteType;
|
|
|
|
property Portrait: Portrait;
|
2016-11-22 22:42:32 +00:00
|
|
|
|
2016-10-13 18:45:52 +00:00
|
|
|
Default
|
|
|
|
{
|
|
|
|
Health 100;
|
|
|
|
Radius 16;
|
|
|
|
Height 56;
|
|
|
|
Mass 100;
|
|
|
|
Painchance 255;
|
|
|
|
Speed 1;
|
|
|
|
+SOLID
|
|
|
|
+SHOOTABLE
|
|
|
|
+DROPOFF
|
|
|
|
+PICKUP
|
|
|
|
+NOTDMATCH
|
|
|
|
+FRIENDLY
|
|
|
|
+SLIDESONWALLS
|
|
|
|
+CANPASS
|
|
|
|
+CANPUSHWALLS
|
|
|
|
+FLOORCLIP
|
|
|
|
+WINDTHRUST
|
|
|
|
+TELESTOMP
|
|
|
|
+NOBLOCKMONST
|
|
|
|
Player.AttackZOffset 8;
|
|
|
|
Player.JumpZ 8;
|
|
|
|
Player.GruntSpeed 12;
|
|
|
|
Player.FallingScreamSpeed 35,40;
|
|
|
|
Player.ViewHeight 41;
|
|
|
|
Player.UseRange 64;
|
|
|
|
Player.ForwardMove 1,1;
|
|
|
|
Player.SideMove 1,1;
|
|
|
|
Player.ColorRange 0,0;
|
|
|
|
Player.SoundClass "player";
|
|
|
|
Player.DamageScreenColor "ff 00 00";
|
|
|
|
Player.MugShotMaxHealth 0;
|
|
|
|
Player.FlechetteType "ArtiPoisonBag3";
|
|
|
|
Player.AirCapacity 1;
|
2016-10-21 17:31:08 +00:00
|
|
|
Player.ViewBob 1;
|
2016-10-13 18:45:52 +00:00
|
|
|
Obituary "$OB_MPDEFAULT";
|
|
|
|
}
|
2016-11-19 12:56:29 +00:00
|
|
|
|
2016-11-30 00:25:51 +00:00
|
|
|
virtual void PlayIdle ()
|
|
|
|
{
|
|
|
|
if (InStateSequence(CurState, SeeState))
|
|
|
|
SetState (SpawnState);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void PlayRunning ()
|
|
|
|
{
|
|
|
|
if (InStateSequence(CurState, SpawnState) && SeeState != NULL)
|
|
|
|
SetState (SeeState);
|
|
|
|
}
|
|
|
|
|
2016-11-19 12:56:29 +00:00
|
|
|
virtual void PlayAttacking ()
|
|
|
|
{
|
|
|
|
if (MissileState != null) SetState (MissileState);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void PlayAttacking2 ()
|
|
|
|
{
|
|
|
|
if (MeleeState != null) SetState (MeleeState);
|
|
|
|
}
|
|
|
|
|
2016-11-22 11:21:55 +00:00
|
|
|
virtual void MorphPlayerThink()
|
|
|
|
{
|
|
|
|
}
|
2017-01-17 23:11:04 +00:00
|
|
|
|
|
|
|
virtual void OnRespawn()
|
|
|
|
{
|
|
|
|
if (sv_respawnprotect && (multiplayer || alwaysapplydmflags))
|
|
|
|
{
|
|
|
|
let invul = Powerup(Spawn("PowerInvulnerable"));
|
|
|
|
invul.EffectTics = 3 * TICRATE;
|
|
|
|
invul.BlendColor = 0; // don't mess with the view
|
|
|
|
invul.bUndroppable = true; // Don't drop this
|
|
|
|
bRespawnInvul = true; // [RH] special effect
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-28 13:30:14 +00:00
|
|
|
override String GetObituary(Actor victim, Actor inflictor, Name mod, bool playerattack)
|
|
|
|
{
|
|
|
|
if (victim.player != player && victim.IsTeammate(self))
|
|
|
|
{
|
|
|
|
victim = self;
|
|
|
|
return String.Format("$OB_FRIENDLY%c", random[Obituary](49, 53));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (mod == 'Telefrag') return "$OB_MPTELEFRAG";
|
|
|
|
|
|
|
|
String message;
|
|
|
|
if (inflictor != NULL)
|
|
|
|
{
|
|
|
|
message = inflictor.GetObituary(victim, inflictor, mod, playerattack);
|
|
|
|
}
|
|
|
|
if (message.Length() == 0 && playerattack && player.ReadyWeapon != NULL)
|
|
|
|
{
|
|
|
|
message = player.ReadyWeapon.GetObituary(victim, inflictor, mod, playerattack);
|
|
|
|
}
|
|
|
|
if (message.Length() == 0)
|
|
|
|
{
|
|
|
|
if (mod == 'BFGSplash') return "$OB_MPBFG_SPLASH";
|
|
|
|
if (mod == 'Railgun') return "$OB_RAILGUN";
|
|
|
|
message = Obituary;
|
|
|
|
}
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-17 23:11:04 +00:00
|
|
|
// This is for SBARINFO.
|
2017-03-07 17:58:18 +00:00
|
|
|
clearscope int, int GetEffectTicsForItem(class<Inventory> item) const
|
2017-01-17 23:11:04 +00:00
|
|
|
{
|
|
|
|
let pg = (class<PowerupGiver>)(item);
|
|
|
|
if (pg != null)
|
|
|
|
{
|
|
|
|
let powerupType = (class<Powerup>)(GetDefaultByType(pg).PowerupType);
|
|
|
|
let powerup = Powerup(FindInventory(powerupType));
|
|
|
|
if(powerup != null)
|
|
|
|
{
|
2017-02-03 09:41:38 +00:00
|
|
|
let maxtics = GetDefaultByType(pg).EffectTics;
|
2017-01-17 23:11:04 +00:00
|
|
|
if (maxtics == 0) maxtics = powerup.default.EffectTics;
|
2017-01-18 00:27:50 +00:00
|
|
|
return powerup.EffectTics, maxtics;
|
2017-01-17 23:11:04 +00:00
|
|
|
}
|
|
|
|
}
|
2017-02-14 20:08:48 +00:00
|
|
|
return -1, -1;
|
2017-01-17 23:11:04 +00:00
|
|
|
}
|
2017-03-21 19:09:09 +00:00
|
|
|
|
2017-03-07 17:58:18 +00:00
|
|
|
native clearscope int GetMaxHealth(bool withupgrades = false) const;
|
2016-11-30 00:25:51 +00:00
|
|
|
native bool ResetAirSupply (bool playgasp = false);
|
2017-01-14 20:27:31 +00:00
|
|
|
native void CheckWeaponSwitch(class<Inventory> item);
|
2017-03-04 11:07:45 +00:00
|
|
|
native clearscope static String GetPrintableDisplayName(Class<Actor> cls);
|
2017-02-17 17:21:59 +00:00
|
|
|
|
2016-10-13 18:45:52 +00:00
|
|
|
}
|
|
|
|
|
2017-01-18 19:23:13 +00:00
|
|
|
class PlayerChunk : PlayerPawn
|
2016-10-13 18:45:52 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+NOSKIN
|
|
|
|
-SOLID
|
|
|
|
-SHOOTABLE
|
|
|
|
-PICKUP
|
|
|
|
-NOTDMATCH
|
|
|
|
-FRIENDLY
|
|
|
|
-SLIDESONWALLS
|
|
|
|
-CANPUSHWALLS
|
|
|
|
-FLOORCLIP
|
|
|
|
-WINDTHRUST
|
|
|
|
-TELESTOMP
|
|
|
|
}
|
|
|
|
}
|
2016-11-19 12:56:29 +00:00
|
|
|
|
2017-03-03 22:04:19 +00:00
|
|
|
class PSprite : Object native play
|
2016-11-19 12:56:29 +00:00
|
|
|
{
|
2017-01-15 18:44:43 +00:00
|
|
|
enum PSPLayers
|
|
|
|
{
|
|
|
|
STRIFEHANDS = -1,
|
|
|
|
WEAPON = 1,
|
|
|
|
FLASH = 1000,
|
|
|
|
TARGETCENTER = 0x7fffffff - 2,
|
|
|
|
TARGETLEFT,
|
|
|
|
TARGETRIGHT,
|
|
|
|
};
|
|
|
|
|
2016-11-22 22:42:32 +00:00
|
|
|
native readonly State CurState;
|
2017-01-15 22:21:38 +00:00
|
|
|
native Actor Caller;
|
2016-11-22 22:42:32 +00:00
|
|
|
native readonly PSprite Next;
|
|
|
|
native readonly PlayerInfo Owner;
|
|
|
|
native SpriteID Sprite;
|
|
|
|
native int Frame;
|
2016-12-26 20:37:22 +00:00
|
|
|
native readonly int RenderStyle;
|
2016-11-22 22:42:32 +00:00
|
|
|
native readonly int ID;
|
|
|
|
native Bool processPending;
|
|
|
|
native double x;
|
|
|
|
native double y;
|
|
|
|
native double oldx;
|
|
|
|
native double oldy;
|
2016-12-26 20:37:22 +00:00
|
|
|
native double alpha;
|
2016-11-22 22:42:32 +00:00
|
|
|
native Bool firstTic;
|
|
|
|
native int Tics;
|
|
|
|
native bool bAddWeapon;
|
|
|
|
native bool bAddBob;
|
|
|
|
native bool bPowDouble;
|
|
|
|
native bool bCVarFast;
|
|
|
|
native bool bFlip;
|
2016-11-28 13:39:25 +00:00
|
|
|
|
|
|
|
native void SetState(State newstate, bool pending = false);
|
|
|
|
|
2016-11-19 12:56:29 +00:00
|
|
|
}
|
|
|
|
|
2016-11-28 22:30:14 +00:00
|
|
|
enum EPlayerState
|
|
|
|
{
|
|
|
|
PST_LIVE, // Playing or camping.
|
|
|
|
PST_DEAD, // Dead on the ground, view follows killer.
|
|
|
|
PST_REBORN, // Ready to restart/respawn???
|
|
|
|
PST_ENTER, // [BC] Entered the game
|
|
|
|
PST_GONE // Player has left the game
|
|
|
|
}
|
|
|
|
|
2017-03-03 22:04:19 +00:00
|
|
|
struct PlayerInfo native play // this is what internally is known as player_t
|
2016-11-19 12:56:29 +00:00
|
|
|
{
|
2017-01-15 23:46:15 +00:00
|
|
|
// technically engine constants but the only part of the playsim using them is the player.
|
|
|
|
const NOFIXEDCOLORMAP = -1;
|
|
|
|
const NUMCOLORMAPS = 32;
|
|
|
|
|
2017-01-14 17:26:59 +00:00
|
|
|
native PlayerPawn mo;
|
2016-11-22 22:42:32 +00:00
|
|
|
native uint8 playerstate;
|
2017-03-18 18:34:03 +00:00
|
|
|
native readonly uint buttons;
|
2016-11-22 22:42:32 +00:00
|
|
|
native uint original_oldbuttons;
|
|
|
|
native readonly Class<PlayerPawn> cls;
|
|
|
|
native float DesiredFOV;
|
2017-01-19 13:00:00 +00:00
|
|
|
native float FOV;
|
2016-11-22 22:42:32 +00:00
|
|
|
native double viewz;
|
|
|
|
native double viewheight;
|
|
|
|
native double deltaviewheight;
|
|
|
|
native double bob;
|
|
|
|
native vector2 vel;
|
|
|
|
native bool centering;
|
|
|
|
native uint8 turnticks;
|
|
|
|
native bool attackdown;
|
|
|
|
native bool usedown;
|
|
|
|
native uint oldbuttons;
|
|
|
|
native int health;
|
2017-03-21 19:09:09 +00:00
|
|
|
native clearscope int inventorytics;
|
2016-11-22 22:42:32 +00:00
|
|
|
native uint8 CurrentPlayerClass;
|
|
|
|
native int frags[MAXPLAYERS];
|
|
|
|
native int fragcount;
|
|
|
|
native int lastkilltime;
|
|
|
|
native uint8 multicount;
|
|
|
|
native uint8 spreecount;
|
|
|
|
native uint16 WeaponState;
|
|
|
|
native Weapon ReadyWeapon;
|
|
|
|
native Weapon PendingWeapon;
|
|
|
|
native PSprite psprites;
|
|
|
|
native int cheats;
|
|
|
|
native int timefreezer;
|
|
|
|
native int16 refire;
|
|
|
|
native int16 inconsistent;
|
|
|
|
native bool waiting;
|
|
|
|
native int killcount;
|
|
|
|
native int itemcount;
|
|
|
|
native int secretcount;
|
|
|
|
native int damagecount;
|
|
|
|
native int bonuscount;
|
|
|
|
native int hazardcount;
|
|
|
|
native int hazardinterval;
|
|
|
|
native Name hazardtype;
|
|
|
|
native int poisoncount;
|
|
|
|
native Name poisontype;
|
|
|
|
native Name poisonpaintype;
|
|
|
|
native Actor poisoner;
|
|
|
|
native Actor attacker;
|
|
|
|
native int extralight;
|
|
|
|
native int16 fixedcolormap;
|
|
|
|
native int16 fixedlightlevel;
|
|
|
|
native int morphtics;
|
|
|
|
native Class<PlayerPawn>MorphedPlayerClass;
|
|
|
|
native int MorphStyle;
|
|
|
|
native Class<Actor> MorphExitFlash;
|
|
|
|
native Class<Weapon> PremorphWeapon;
|
|
|
|
native int chickenPeck;
|
|
|
|
native int jumpTics;
|
|
|
|
native bool onground;
|
|
|
|
native int respawn_time;
|
|
|
|
native Actor camera;
|
|
|
|
native int air_finished;
|
|
|
|
native Name LastDamageType;
|
|
|
|
native Actor MUSINFOactor;
|
|
|
|
native int8 MUSINFOtics;
|
|
|
|
native bool settings_controller;
|
|
|
|
native int8 crouching;
|
|
|
|
native int8 crouchdir;
|
|
|
|
native Bot bot;
|
|
|
|
native float BlendR;
|
|
|
|
native float BlendG;
|
|
|
|
native float BlendB;
|
|
|
|
native float BlendA;
|
|
|
|
native String LogText;
|
|
|
|
native double MinPitch;
|
|
|
|
native double MaxPitch;
|
|
|
|
native double crouchfactor;
|
|
|
|
native double crouchoffset;
|
|
|
|
native double crouchviewdelta;
|
|
|
|
native Actor ConversationNPC;
|
|
|
|
native Actor ConversationPC;
|
|
|
|
native double ConversationNPCAngle;
|
|
|
|
native bool ConversationFaceTalker;
|
2017-03-13 11:48:25 +00:00
|
|
|
native @WeaponSlots weapons;
|
2017-01-17 16:31:54 +00:00
|
|
|
|
2016-11-22 22:42:32 +00:00
|
|
|
/* these are not doable yet
|
|
|
|
ticcmd_t cmd;
|
|
|
|
usercmd_t original_cmd;
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2017-01-01 18:23:43 +00:00
|
|
|
native bool MorphPlayer(playerinfo p, Class<PlayerPawn> spawntype, int duration, int style, Class<Actor> enter_flash = null, Class<Actor> exit_flash = null);
|
2016-11-25 17:41:00 +00:00
|
|
|
native bool UndoPlayerMorph(playerinfo player, int unmorphflag = 0, bool force = false);
|
2016-11-26 18:23:22 +00:00
|
|
|
native bool PoisonPlayer(Actor poisoner, Actor source, int poison);
|
2016-11-27 11:18:06 +00:00
|
|
|
native void PoisonDamage(Actor source, int damage, bool playPainSound);
|
2016-11-19 12:56:29 +00:00
|
|
|
native void SetPsprite(int id, State stat, bool pending = false);
|
2016-11-19 15:39:45 +00:00
|
|
|
native void SetSafeFlash(Weapon weap, State flashstate, int index);
|
2017-03-03 22:04:19 +00:00
|
|
|
native PSprite GetPSprite(int id) const;
|
|
|
|
native PSprite FindPSprite(int id) const;
|
2016-11-28 09:41:36 +00:00
|
|
|
native void SetLogNumber (int text);
|
|
|
|
native void SetLogText (String text);
|
2017-01-19 12:25:56 +00:00
|
|
|
native void DropWeapon();
|
|
|
|
native void BringUpWeapon();
|
2017-03-28 19:29:14 +00:00
|
|
|
native bool Resurrect();
|
2016-11-25 17:41:00 +00:00
|
|
|
|
2017-03-03 22:04:19 +00:00
|
|
|
native String GetUserName() const;
|
|
|
|
native Color GetColor() const;
|
2017-03-18 18:34:03 +00:00
|
|
|
native Color GetDisplayColor() const;
|
2017-03-03 22:04:19 +00:00
|
|
|
native int GetColorSet() const;
|
|
|
|
native int GetPlayerClassNum() const;
|
|
|
|
native int GetSkin() const;
|
|
|
|
native bool GetNeverSwitch() const;
|
|
|
|
native int GetGender() const;
|
|
|
|
native int GetTeam() const;
|
|
|
|
native float GetAutoaim() const;
|
2017-03-18 14:42:34 +00:00
|
|
|
native bool GetNoAutostartMap() const;
|
2017-02-28 10:23:40 +00:00
|
|
|
native void SetFOV(float fov);
|
2017-03-26 20:04:58 +00:00
|
|
|
native clearscope bool HasWeaponsInSlot(int slot) const;
|
2017-03-25 20:40:17 +00:00
|
|
|
|
|
|
|
clearscope int fragSum () const
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int allfrags = 0;
|
|
|
|
int playernum = mo.PlayerNumber();
|
|
|
|
|
|
|
|
for (i = 0; i < MAXPLAYERS; i++)
|
|
|
|
{
|
|
|
|
if (playeringame[i]
|
|
|
|
&& i!=playernum)
|
|
|
|
{
|
|
|
|
allfrags += frags[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// JDC hack - negative frags.
|
|
|
|
allfrags -= frags[playernum];
|
|
|
|
return allfrags;
|
|
|
|
}
|
|
|
|
|
2016-11-22 11:21:55 +00:00
|
|
|
}
|
2017-02-11 15:11:48 +00:00
|
|
|
|
|
|
|
struct PlayerClass native
|
|
|
|
{
|
|
|
|
native class<Actor> Type;
|
|
|
|
native uint Flags;
|
|
|
|
native Array<int> Skins;
|
|
|
|
|
|
|
|
native bool CheckSkin(int skin);
|
2017-02-17 22:16:07 +00:00
|
|
|
native void EnumColorsets(out Array<int> data);
|
|
|
|
native Name GetColorsetName(int setnum);
|
2017-02-11 15:11:48 +00:00
|
|
|
}
|
2017-02-17 20:51:23 +00:00
|
|
|
|
|
|
|
struct PlayerSkin native
|
|
|
|
{
|
2017-02-17 21:12:56 +00:00
|
|
|
native readonly String SkinName;
|
2017-02-17 20:51:23 +00:00
|
|
|
native readonly String Face;
|
|
|
|
native readonly uint8 gender;
|
|
|
|
native readonly uint8 range0start;
|
|
|
|
native readonly uint8 range0end;
|
|
|
|
native readonly bool othergame;
|
|
|
|
native readonly Vector2 Scale;
|
|
|
|
native readonly int sprite;
|
|
|
|
native readonly int crouchsprite;
|
|
|
|
native readonly int namespc;
|
|
|
|
};
|
2017-02-18 00:20:07 +00:00
|
|
|
|
|
|
|
struct Team native
|
|
|
|
{
|
|
|
|
const NoTeam = 255;
|
|
|
|
const Max = 16;
|
|
|
|
native String mName;
|
2017-02-11 15:11:48 +00:00
|
|
|
}
|