NS/releases/3.1/source/mod/AvHMovementUtil.h
tankefugl 06bd7805bc Mantis 1104:
- Added an optimistic latency-based prediction for alien energy usage for weapons, making missing attacks much less frequent.

The prediction takes into account the player's latency and adrenaline upgrade, and adds that to the test performed by AvHMUHasEnoughAlienEnergy so that the client may predict how much energy the player has on the server when the +attack reaches it.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@335 67975925-1194-0748-b3d5-c16f83f1a3a1
2005-09-26 19:18:19 +00:00

42 lines
No EOL
1.8 KiB
C

//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHMovementUtil.h $
// $Date: 2002/10/03 18:59:04 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMovementUtil.h,v $
// Revision 1.4 2002/10/03 18:59:04 Flayra
// - Refactored energy
//
// Revision 1.3 2002/05/23 02:33:20 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef MOVEMENT_UTIL_H
#define MOVEMENT_UTIL_H
#include "mod/AvHBasePlayerWeaponConstants.h"
#include "mod/AvHSpecials.h"
int AvHMUGetHull(bool inIsDucking, int inUserVar);
int AvHMUGetOriginOffsetForUser3(AvHUser3 inUser3);
int AvHMUGetOriginOffsetForMessageID(AvHMessageID inMessageID);
bool AvHMUGetCanDuck(int inUser3);
bool AvHMUDeductAlienEnergy(float& ioFuser, float inNormAmount);
bool AvHMUGiveAlienEnergy(float& ioFuser, float inNormAmount);
bool AvHMUGetEnergyCost(AvHWeaponID inWeaponID, float& outEnergyCost);
float AvHMUGetWalkSpeedFactor(AvHUser3 inUser3);
bool AvHMUHasEnoughAlienEnergy(float& ioFuser, float inNormAmount, float latency = 0.0f);
void AvHMUUpdateAlienEnergy(float inTimePassed, int inUser3, int inUser4, float& ioFuser);
void AvHMUUpdateJetpackEnergy(bool inIsJetpacking, float theTimePassed, float& ioJetpackEnergy);
#endif