about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/client/gc_client.cpp2
-rw-r--r--src/game/client/gc_render_obj.cpp35
-rw-r--r--src/game/g_tuning.h10
-rw-r--r--src/game/server/gs_common.h1
-rw-r--r--src/game/server/gs_server.cpp27
5 files changed, 45 insertions, 30 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index 580eb302..df6c3efd 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -805,7 +805,7 @@ void render_game()
 			{
 				INPUT_EVENT e = inp_get_event(i);
 	
-				if (!(e.ch >= 0 && e.ch < 32))
+				if(e.ch > 32)
 				{
 					if (chat_input_len < sizeof(chat_input) - 1)
 					{
diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp
index 839a5261..5f00b9cf 100644
--- a/src/game/client/gc_render_obj.cpp
+++ b/src/game/client/gc_render_obj.cpp
@@ -154,8 +154,6 @@ void render_laser(const struct NETOBJ_LASER *current)
 	vec2 from = vec2(current->from_x, current->from_y);
 	vec2 dir = normalize(pos-from);
 
-
-
 	float ticks = client_tick() + client_intratick() - current->eval_tick;
 	float ms = (ticks/50.0f) * 1000.0f;
 	float a =  ms / tuning.laser_bounce_delay;
@@ -171,23 +169,30 @@ void render_laser(const struct NETOBJ_LASER *current)
 	gfx_texture_set(-1);
 	gfx_quads_begin();
 	
-	vec4 start_color(0.25f,0.25f,0.5f,1.0f);
-	vec4 end_color(0.85f,0.85f,1.0f,1.0f);
-	start_color = end_color;
 	
-	gfx_setcolorvertex(0, start_color.r, start_color.g, start_color.b, start_color.a);
-	gfx_setcolorvertex(1, start_color.r, start_color.g, start_color.b, start_color.a);
-	gfx_setcolorvertex(2, end_color.r, end_color.g, end_color.b, end_color.a);
-	gfx_setcolorvertex(3, end_color.r, end_color.g, end_color.b, end_color.a);
+	vec4 inner_color(0.25f,0.25f,0.5f,1.0f);
+	vec4 outer_color(0.85f,0.85f,1.0f,1.0f);
 	
-	from = mix(from, pos, a);
+	gfx_setcolorvertex(0, inner_color.r, inner_color.g, inner_color.b, 0.2f); // center
+	gfx_setcolorvertex(1, outer_color.r, outer_color.g, outer_color.b, 1.0f);
+	gfx_setcolorvertex(2, inner_color.r, inner_color.g, inner_color.b, 0.2f); // center
+	gfx_setcolorvertex(3, outer_color.r, outer_color.g, outer_color.b, 1.0f);
+	
+	//from = mix(from, pos, a);
 	
 	gfx_quads_draw_freeform(
-			from.x-out.x, from.y-out.y,
+			from.x, from.y,
 			from.x+out.x, from.y+out.y,
-			pos.x-out.x, pos.y-out.y,
+			pos.x, pos.y,
 			pos.x+out.x, pos.y+out.y
 		);
+
+	gfx_quads_draw_freeform(
+			from.x, from.y,
+			from.x-out.x, from.y-out.y,
+			pos.x, pos.y,
+			pos.x-out.x, pos.y-out.y
+		);
 		
 	gfx_quads_end();
 	
@@ -197,12 +202,14 @@ void render_laser(const struct NETOBJ_LASER *current)
 		gfx_texture_set(data->images[IMAGE_PARTICLES].id);
 		gfx_quads_begin();
 
-		gfx_setcolor(end_color.r, end_color.g, end_color.b, end_color.a);
+		gfx_setcolor(outer_color.r, outer_color.g, outer_color.b, outer_color.a);
 	
 		int sprites[] = {SPRITE_PART_SPLAT01, SPRITE_PART_SPLAT02, SPRITE_PART_SPLAT03};
 		select_sprite(sprites[client_tick()%3]);
 		gfx_quads_setrotation(client_tick());
-		gfx_quads_draw(pos.x, pos.y, 32,32);
+		gfx_quads_draw(pos.x, pos.y, 24,24);
+		//gfx_setcolor(inner_color.r, inner_color.g, inner_color.b, 1.0f);
+		//gfx_quads_draw(pos.x, pos.y, 24,24);
 		gfx_quads_end();
 	}
 	
diff --git a/src/game/g_tuning.h b/src/game/g_tuning.h
index b80398d4..80b3310f 100644
--- a/src/game/g_tuning.h
+++ b/src/game/g_tuning.h
@@ -1,5 +1,5 @@
 /* physics tuning */
-MACRO_TUNING_PARAM(ground_control_speed, 350.0f / ticks_per_second)
+MACRO_TUNING_PARAM(ground_control_speed, 10.0f)
 MACRO_TUNING_PARAM(ground_control_accel, 100.0f / ticks_per_second)
 MACRO_TUNING_PARAM(ground_friction, 0.5f)
 MACRO_TUNING_PARAM(ground_jump_impulse, 12.6f)
@@ -8,14 +8,14 @@ MACRO_TUNING_PARAM(air_control_speed, 250.0f / ticks_per_second)
 MACRO_TUNING_PARAM(air_control_accel, 1.5f)
 MACRO_TUNING_PARAM(air_friction, 0.95f)
 MACRO_TUNING_PARAM(hook_length, 34*10.0f)
-MACRO_TUNING_PARAM(hook_fire_speed, 45.0f)
+MACRO_TUNING_PARAM(hook_fire_speed, 80.0f)
 MACRO_TUNING_PARAM(hook_drag_accel, 3.0f)
 MACRO_TUNING_PARAM(hook_drag_speed, 15.0f)
 MACRO_TUNING_PARAM(gravity, 0.5f)
 
-MACRO_TUNING_PARAM(velramp_start, 500)
+MACRO_TUNING_PARAM(velramp_start, 550)
 MACRO_TUNING_PARAM(velramp_range, 2000)
-MACRO_TUNING_PARAM(velramp_curvature, 1.5f)
+MACRO_TUNING_PARAM(velramp_curvature, 1.4f)
 
 /* weapon tuning */
 MACRO_TUNING_PARAM(gun_curvature, 1.5f)
@@ -25,7 +25,7 @@ MACRO_TUNING_PARAM(shotgun_curvature, 1.5f)
 MACRO_TUNING_PARAM(shotgun_speed, 2200.0f)
 
 MACRO_TUNING_PARAM(grenade_curvature, 7.0f)
-MACRO_TUNING_PARAM(grenade_speed, 900.0f)
+MACRO_TUNING_PARAM(grenade_speed, 1000.0f)
 
 MACRO_TUNING_PARAM(laser_reach, 800.0f)
 MACRO_TUNING_PARAM(laser_bounce_delay, 150)
diff --git a/src/game/server/gs_common.h b/src/game/server/gs_common.h
index 0de81318..494a16eb 100644
--- a/src/game/server/gs_common.h
+++ b/src/game/server/gs_common.h
@@ -204,6 +204,7 @@ public:
 	projectile(int type, int owner, vec2 pos, vec2 vel, int span, entity* powner,
 		int damage, int flags, float force, int sound_impact, int weapon);
 
+	vec2 get_pos(float time);
 	void fill_info(NETOBJ_PROJECTILE *proj);
 
 	virtual void reset();
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp
index fa3f9925..753a53a3 100644
--- a/src/game/server/gs_server.cpp
+++ b/src/game/server/gs_server.cpp
@@ -406,7 +406,7 @@ void projectile::reset()
 	world->destroy_entity(this);
 }
 
-void projectile::tick()
+vec2 projectile::get_pos(float time)
 {
 	float curvature = 0;
 	float speed = 0;
@@ -426,10 +426,17 @@ void projectile::tick()
 		speed = tuning.gun_speed;
 	}
 	
+	return calc_pos(pos, direction, curvature, speed, time);
+}
+
+
+void projectile::tick()
+{
+	
 	float pt = (server_tick()-start_tick-1)/(float)server_tickspeed();
 	float ct = (server_tick()-start_tick)/(float)server_tickspeed();
-	vec2 prevpos = calc_pos(pos, direction, curvature, speed, pt);
-	vec2 curpos = calc_pos(pos, direction, curvature, speed, ct);
+	vec2 prevpos = get_pos(pt);
+	vec2 curpos = get_pos(ct);
 
 	lifespan--;
 	
@@ -466,13 +473,10 @@ void projectile::fill_info(NETOBJ_PROJECTILE *proj)
 
 void projectile::snap(int snapping_client)
 {
-	/*float ct = (server_tick()-start_tick)/(float)server_tickspeed();*/
-	/*vec2 curpos = calc_pos(pos, vel, -7.5f*server_tickspeed(), ct);*/
-
-	/*if(distance(players[snapping_client].pos, curpos) > 1000.0f)
-		return;*/
-		
-	/* TODO: FIX ME */
+	float ct = (server_tick()-start_tick)/(float)server_tickspeed();
+	
+	if(distance(players[snapping_client].pos, get_pos(ct)) > 1000.0f)
+		return;
 
 	NETOBJ_PROJECTILE *proj = (NETOBJ_PROJECTILE *)snap_new_item(NETOBJTYPE_PROJECTILE, id, sizeof(NETOBJ_PROJECTILE));
 	fill_info(proj);
@@ -564,7 +568,10 @@ void laser::reset()
 void laser::tick()
 {
 	if(server_tick() > eval_tick+(server_tickspeed()*tuning.laser_bounce_delay)/1000.0f)
+	{
+		create_sound(pos, SOUND_RIFLE_BOUNCE);
 		do_bounce();
+	}
 
 }