Implement double/triple jump.

This commit is contained in:
UnknownShadow200 2016-01-11 15:28:19 +11:00
parent b79de4c457
commit ac33a869af
7 changed files with 20 additions and 19 deletions

View File

@ -96,7 +96,6 @@ namespace ClassicalSharp {
buttons[3].Disabled = noGlobalHacks || !p.CanSpeed;
buttons[4].Disabled = noGlobalHacks || !p.CanSpeed;
buttons[6].Disabled = noGlobalHacks || !p.CanPushbackBlocks;
buttons[4].Disabled = true; // TODO: get this working
}
ButtonWidget Make( int x, int y, string text, Action<Game, Widget> onClick,

View File

@ -66,6 +66,7 @@
<DefineConstants>TRACE;USE_DX</DefineConstants>
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<StartAction>Project</StartAction>
<StartArguments>wwwf ver 127.0.0.1 25565</StartArguments>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>

View File

@ -69,13 +69,13 @@ namespace ClassicalSharp {
} else if( TouchesAnyRope() ) {
Velocity.Y += speeding ? 0.15f : 0.10f;
canLiquidJump = false;
} else if( onGround ) {
Velocity.Y = 0;
} else if( onGround ) {
DoNormalJump();
}
}
void DoNormalJump() {
Velocity.Y = 0;
Velocity.Y += jumpVel;
if( speeding ) Velocity.Y += jumpVel;
if( halfSpeeding ) Velocity.Y += jumpVel / 2;
@ -96,10 +96,13 @@ namespace ClassicalSharp {
void PhysicsTick( float xMoving, float zMoving ) {
if( noClip )
onGround = false;
float multiply = GetBaseMultiply();
float multiply = GetBaseMultiply();
float modifier = LowestSpeedModifier();
float horMul = multiply * modifier;
float yMul = Math.Max( 1f, multiply / 5 ) * modifier;
float horMul = multiply * modifier;
if( !secondJump ) { horMul *= 93f; yMul *= 10f; }
else if( !firstJump ) { horMul *= 46.5f; yMul *= 7.5f; }
if( TouchesAnyWater() && !flying && !noClip ) {
MoveNormal( xMoving, zMoving, 0.02f * horMul, waterDrag, liquidGrav, yMul );

View File

@ -318,10 +318,10 @@ namespace ClassicalSharp {
noClip = !noClip;
} else if( key == keys[KeyBinding.Jump] && !onGround ) {
if( firstJump && CanDoubleJump && DoubleJump ) {
//DoNormalJump(); TODO: get this working
DoNormalJump();
firstJump = false;
} else if( secondJump && CanDoubleJump && DoubleJump ) {
//DoNormalJump(); TODO: get this working
DoNormalJump();
secondJump = false;
}
} else {

View File

@ -58,14 +58,12 @@ namespace ClassicalSharp {
bool sendHeldBlock, useMessageTypes;
int envMapApperanceVer = 2;
static string[] clientExtensions = {
"ClickDistance", "CustomBlocks", "HeldBlock",
"EmoteFix", "TextHotKey", "ExtPlayerList",
"EnvColors", "SelectionCuboid", "BlockPermissions",
"ChangeModel", "EnvMapAppearance", "EnvWeatherType",
"HackControl", "MessageTypes", "PlayerClick",
"FullCP437", "LongerMessages",
"ClickDistance", "CustomBlocks", "HeldBlock", "EmoteFix", "TextHotKey", "ExtPlayerList",
"EnvColors", "SelectionCuboid", "BlockPermissions", "ChangeModel", "EnvMapAppearance",
"EnvWeatherType", "HackControl", "MessageTypes", "PlayerClick", "FullCP437",
"LongerMessages", "BlockDefinitions", "BlockDefinitionsExt",
// proposals
"BlockDefinitions", "BlockDefinitionsExt", "TextColors",
"BulkBlockUpdate", "TextColors",
};
void HandleCpeExtInfo() {
@ -499,7 +497,7 @@ namespace ClassicalSharp {
byte block = reader.buffer[i + bulkCount * sizeof(int)];
Vector3I coords = game.Map.GetCoords( indices[i] );
if( !game.Map.IsValidPos( coords ) ) {
if( coords.X < 0 ) {
Utils.LogDebug( "Server tried to update a block at an invalid position!" );
continue;
}

View File

@ -228,8 +228,8 @@ namespace ClassicalSharp.Network {
HttpWebRequest MakeRequest( Request request ) {
HttpWebRequest req = (HttpWebRequest)WebRequest.Create( request.Url );
req.AutomaticDecompression = DecompressionMethods.GZip;
req.ReadWriteTimeout = 15 * 1000;
req.Timeout = 15 * 1000;
req.ReadWriteTimeout = 90 * 1000;
req.Timeout = 90 * 1000;
req.Proxy = null;
req.UserAgent = Program.AppName;

View File

@ -40,8 +40,8 @@ namespace Launcher2 {
protected HttpWebResponse MakeRequest( string uri, string referer, string data ) {
HttpWebRequest request = (HttpWebRequest)WebRequest.Create( uri );
request.UserAgent = Program.AppName;
request.ReadWriteTimeout = 15 * 1000;
request.Timeout = 15 * 1000;
request.ReadWriteTimeout = 90 * 1000;
request.Timeout = 90 * 1000;
request.Referer = referer;
request.KeepAlive = true;
request.CookieContainer = cookies;