Commit graph

233 commits

Author SHA1 Message Date
Kp 2401bd60ce Pass object_base &to homing_missile_turn_towards_velocity 2016-04-23 17:59:47 +00:00
Kp 34417e9b7a Simplify track_goal setup
Fixes: 7cce4e292d ("Fixed up non-NEWHOMER code for testing purposes")
2016-03-19 19:08:10 +00:00
zico 49a336b263 Reintroduced the lost HOMING_TURN_TIME division for homing missile acceleration 2016-03-03 19:39:29 +01:00
zico 7cce4e292d Fixed up non-NEWHOMER code for testing purposes 2016-02-29 16:42:49 +01:00
zico 901a554e96 New powerup management code: Addeed functions and packet type to keep track of original and current level inventory as well as player and thief inventories. Calling maybe_drop_net_powerup() for all ammo based weapons except Concussion missiles. Limiting maybe_drop_net_powerup() to only spawn items missing from initial level inventory. Added function to let host respawn items that were lost for whatever reason. Expanded maybe_drop_net_powerup() and child functions to be able to drop item based on a random player. Changed back maybe_drop_secondary_weapon_egg() to its original behavior, dropping 3 of each type max. 2016-02-25 14:11:08 +01:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp 3d13e66f6a Use C++ array in more places 2016-01-26 03:45:08 +00:00
Kp 25feb65a6f Remove unnecessary pointer subtraction in laser.cpp
`parent` can be compared to `Viewer` without converting `Viewer` to an
index.
2016-01-09 16:38:14 +00:00
Kp a3ae630829 Remove default argument for basic_ptridx(index) 2016-01-09 16:38:14 +00:00
Kp 9ceedc96a8 Propagate valptridx requirement up 2016-01-09 16:38:14 +00:00
Kp cefc79f869 Construct find_point_seg segptridx explicitly 2016-01-09 16:38:13 +00:00
Kp 98f5afa9f8 Remove default argument for basic_ptr(pointer,array &) 2016-01-09 16:38:13 +00:00
Kp 287a74f88b Multiplex do_laser_firing_player flags 2015-12-22 04:18:52 +00:00
Kp f4a5040a60 Remove write-only Last_laser_fired_time 2015-12-22 04:18:52 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +00:00
Kp d479819931 Use absolute_sibling to reduce global references for ptridx 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp 2b51578ba6 Use enum class for Player_dead_state (formerly Player_is_dead) 2015-12-15 04:09:35 +00:00
Kp 708dc0a7e1 Use vobjptr/vcobjptr for more Objects[] access 2015-12-03 03:26:49 +00:00
Kp b683b4cc68 Scope weapon type 2015-12-03 03:26:49 +00:00
Kp 31d538ebe2 Use helper for robot weapon type 2015-12-03 03:26:48 +00:00
Kp 0c75aecc45 Check most uses of object id 2015-11-27 03:56:13 +00:00
Kp f09635089e Compact track_track_goal 2015-11-15 22:30:41 +00:00
Kp 44753209d6 Move homing_object_dist to object.ctype.player_info 2015-11-14 18:17:22 +00:00
Kp 6b353cb9ac Move player powerup_flags to object.ctype.player_info 2015-11-07 21:55:59 +00:00
Kp 8a81e25ab0 Move player laser_level to object.ctype.player_info 2015-11-07 21:55:59 +00:00
Kp 6037372cdf Move player vulcan_ammo to object.ctype.player_info 2015-11-07 21:55:59 +00:00
Kp 6fd6436f14 Move player energy to object.ctype.player_info 2015-11-07 21:55:58 +00:00
Kp 17b8b64980 Use macro get_local_player_flags for player's flags 2015-10-30 02:52:56 +00:00
Kp dc5dfb80e8 Use macro get_local_player_secondary_ammo for player's secondary_ammo 2015-10-30 02:52:56 +00:00
Kp ea5b7a08c1 Use macro get_local_player_energy for local player's energy 2015-10-30 02:52:55 +00:00
Kp 533f1cb3bb Qualify references to primary weapons 2015-10-18 21:01:18 +00:00
Kp 4585faa461 Cache reference to secondary_ammo 2015-10-10 03:44:14 +00:00
Kp ffd6c113ae Move fwdwall.h -> fwd-wall.h for consistency 2015-10-09 02:46:10 +00:00
Kp 230bc630ed Store FriendMissileView inside MissileViewEnabled
This allows it to persist silently when configuration files are read and
rewritten by versions of Rebirth which do not understand
FriendMissileView.
2015-09-26 21:17:14 +00:00
zico 69353631f0 Made missile views from friendly players optional (off by default) 2015-09-26 20:28:49 +02:00
Kp ff8aab4694 Move guided missile logic to helper function
Fix original bug that tested wrong field for guided missile signature
check.
2015-09-15 02:48:03 +00:00
zico e0785251c4 Reset homing_object_dist along with d_homer_tick_step instead of every frame to make sure lock indicator is visible in frames where homers wait for a new chance to turn; Also moved call of calc_d_tick() to calc_frame_time() - shouldn't be nested in calc_d_homer_tick() 2015-09-10 14:11:30 +02:00
zico cbaac96324 Fixed (hacked) homing missiles fired by bots that would not track players if player with lowest objnum is dead 2015-09-10 13:19:34 +02:00
Kp 2eeca09ae1 Improve create_smart_children
Use accurate squared distance instead of quick non-squared distance.
Simplify target choice loop.
2015-08-17 02:44:56 +00:00
Kp e5683593ef Expand ZERO_VECTOR inline 2015-08-13 03:15:53 +00:00
Kp bda7fef3a0 Use get_local_player to compute reference to local player 2015-07-25 23:10:46 +00:00
Kp f38e80c053 Use get_local_plrobj to compute reference to object of local player 2015-07-25 23:10:45 +00:00
Kp d4c2152009 Shorten calc_d_tick 2015-07-18 21:01:57 +00:00
Kp 2b604d6193 Use valptr for laser.cpp 2015-07-12 01:04:20 +00:00
Kp a523171748 Shorten calc_d_homer_tick
Combine redundant write to d_homer_tick_step
Combine redundant write to static timer
Only test for exceeding 3*cap if timer >= 1*cap
2015-05-30 16:53:49 +00:00
zico b04282e791 Using one global yet independent timeer for homing missiles similar to d_tick instead of having one in each missile object. Also decreased HOMING_TURNING_TIME to 25 FPS base 2015-05-30 18:29:41 +02:00
zico 7414b8165d Fixed little regression from previous commit: Do not increade homing tick every frame but according to turn time - duh 2015-05-28 16:07:24 +02:00
zico 7ba3d1317b Isolated all of the homing code into time-depending condition determined by track_turn_time and added track_turn_tick to make target re-discovery dependent on the individual missile tracking instead of global d_tick_count 2015-05-28 15:22:40 +02:00
Kp ed86b53395 Make Muzzle_queue_index static 2015-05-09 17:39:01 +00:00
Kp b5eae4c809 Split create_smart_children 2015-05-09 17:38:58 +00:00
Kp 08a42a68ff Pass vcobjptridx to laser_are_related 2015-05-09 17:38:58 +00:00
Kp 7e65d73e72 Factor out laser_are_related special cases 2015-05-09 17:38:58 +00:00
Kp 0d564814f5 Convert Primary_weapon to primary_weapon_index_t 2015-04-26 20:15:57 +00:00
Kp 4d046c5336 Split auto_select_weapon 2015-04-26 20:15:51 +00:00
Kp 65a0d35678 Remove bogus Int3 in object_to_object_visibility
A Future Pilot reports that find_vector_intersection can return an
unhandled fate.  When Int3 is enabled, this crashes the game.  Replace
the Int3 with a debug print.

Reported-by: A Future Pilot <http://www.dxx-rebirth.com/frm/index.php/topic,2024.msg21633.html#msg21633>
2015-04-24 01:39:35 +00:00
Kp 9d213b5282 Wrap player_has_weapon return type 2015-04-19 04:18:50 +00:00
zico 1fd7cb8929 Fusion cannon in Descent 1 was nerfed for Multiplayer after it was made stronger in 1.1 patch. This is fine but players expressed it being not desirable for Coop - which makes sense to me. This fix only applies the nerf to non-Coop games. 2015-04-08 15:05:03 +02:00
Kp 9157e5f970 Use enum class for player_awareness_type_t 2015-04-02 02:36:53 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp 91d31b1952 Wrap object signature in subtype 2015-03-22 18:49:21 +00:00
Kp 2c09f9fa90 Propagate special types for distance/magnitude 2015-03-12 02:21:19 +00:00
Kp 32b9202e1f Watch missiles when available 2015-02-14 22:48:28 +00:00
Kp dc8b88eed4 Convert various loops to range_for 2015-02-14 22:48:27 +00:00
Kp 078d9513e0 Pass end-of-list for ignore_obj_list 2015-02-05 03:03:51 +00:00
Kp 99a4a0ed62 Capture range_for by-value temporaries as const
Modifying a by-value temporary does not affect the underlying container,
so modifying it is almost always a bug.  Require use of a by-reference
capture when modification is desired.

sed -i -e 's/range_for\s*(\s*\(const\s\+\)\?auto\s\+\([[:alpha:]_]\)/range_for (const auto \2/g'
2015-02-05 03:03:49 +00:00
Kp c8b5fe5552 Pass find_vector_intersection arg by & 2015-01-20 02:46:42 +00:00
Kp fbac119095 Propagate use of objptridx_t 2014-12-23 04:20:27 +00:00
Kp 2d8f8b5d4a Reduce inclusion of wall.h 2014-12-22 04:35:49 +00:00
Kp cf31cc4a5d Switch Laser_render to vobjptr_t 2014-11-30 22:09:23 +00:00
Kp 5aaf847c41 Fix various -Wnarrowing errors 2014-11-26 03:39:21 +00:00
Kp d63be88eb0 Propagate use of vsegptridx_t 2014-11-23 04:58:45 +00:00
Kp a17cf6f808 Avoid slicing into objnum_t local 2014-11-20 03:00:41 +00:00
Kp 2c349136cc Avoid slicing into segnum_t local 2014-11-20 03:00:36 +00:00
Kp fda3fc33f3 Skip unnecessary sqrt for omega cannon 2014-11-11 04:25:47 +00:00
Kp d5d958af96 Add make_random_vector that returns result 2014-11-04 01:33:45 +00:00
Kp df6b4bd783 Add vm_vec_rotate that returns result 2014-11-04 01:31:22 +00:00
Kp 40eb2e6b01 Add vm_vec_scale_add that returns result 2014-11-02 03:43:57 +00:00
Kp a09fcd7753 Add vm_vec_add that returns result 2014-10-30 03:11:06 +00:00
Kp 5bb9c88979 Add vm_vec_sub that returns result 2014-10-29 03:24:31 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp c87e84217b Pass phys_apply_* vms_vector by const & 2014-10-26 21:37:34 +00:00
Kp ad717e59e8 Pass laser vectors as const & 2014-10-26 21:37:27 +00:00
Kp fdfd849bd2 Pass explode_badass_weapon position by const & 2014-10-26 21:36:31 +00:00
Kp 7e955c2c7b Pass object_create_explosion_sub position by & 2014-10-26 21:36:25 +00:00
Kp 2a5265493e Pass obj_create position vms_vector by & 2014-10-26 21:35:16 +00:00
Kp 9dea4b4d88 Pass sound vms_vector arg by & 2014-10-26 21:33:50 +00:00
Kp a32547af16 Pass position-related vms_vector arg by & 2014-10-22 02:46:03 +00:00
Kp fb641b3250 Wrap object iteration idiom 2014-10-12 23:05:46 +00:00
Kp c928c09884 Skip sqrt for homing check 2014-10-10 02:41:51 +00:00
Kp 3d6d2d3f14 Pass make_random_vector arg by & 2014-10-02 03:02:38 +00:00
Kp 5af79382a5 Pass vm_vec_rotate arg by & 2014-10-01 02:28:42 +00:00
Kp 99f681c8ea Pass vm_vector_2_matrix arg by & 2014-10-01 02:28:42 +00:00
Kp 73545f1dab Pass vm_vec_normalized_dir_quick arg by & 2014-10-01 02:28:41 +00:00
Kp 1fff2db9a8 Pass vm_vec_dist_quick arg by & 2014-10-01 02:28:41 +00:00
Kp ac39749382 Pass vm_vec_dist arg by & 2014-10-01 02:28:41 +00:00
Kp 05a91f9b58 Pass vm_vec_scale_add2 arguments by & 2014-09-28 21:43:14 +00:00
Kp 4104bf4f11 Pass vm_vec_scale_add arguments by & 2014-09-28 21:43:14 +00:00
Kp b5949cc4a0 Pass vm_vec_copy_scale arguments by & 2014-09-28 21:43:14 +00:00
Kp 0b2636d535 Pass vm_vec_add2 arguments by & 2014-09-28 21:43:00 +00:00
Kp 00b59c3058 Pass vm_vec_dot arguments by & 2014-09-28 21:11:48 +00:00
Kp 321bbe37d8 Pass vm_vec_sub arguments by & 2014-09-28 21:11:45 +00:00
Kp 2107b52764 Pass vm_vec_add arguments by & 2014-09-28 21:11:40 +00:00
Kp 74925e9b45 Pass vm_vec_scale dest by & 2014-09-28 21:11:05 +00:00
Kp f12273746f Pass vm_vec_zero v by & 2014-09-28 21:11:04 +00:00
Kp a620a59bda Pass vm_vec_normalize_quick v by & 2014-09-28 21:11:04 +00:00
Kp a550673639 Pass vm_vec_normalize v by & 2014-09-28 21:11:03 +00:00
Kp dfdd4ddd29 Pass vm_vec_mag_quick v by const& 2014-09-28 21:11:03 +00:00
Kp 1e6bf36e20 Pass vm_vec_mag v by const& 2014-09-28 21:11:03 +00:00
Kp 24697ba109 Propagate for variables in similar/main/laser.cpp 2014-09-26 02:42:09 +00:00
Kp 0c7e5aa178 Avoid slicing obj_create return value 2014-09-08 03:24:48 +00:00
Kp b95759aecc Propagate use of objptridx 2014-08-23 23:53:56 +00:00
Kp 66cb80c343 Propagate use of objptridx 2014-08-17 20:31:18 +00:00
Kp bd739041f8 Remove special case for SP homing missiles
The special case let robot homing missiles track players without a line
of sight and prevented player homing missiles from tracking robots out
of the player's sight.
2014-08-16 21:52:25 +00:00
Kp 125d9257be Use special type names for segment/object numbers 2014-08-13 02:57:12 +00:00
Kp c2fb6c728f Fix D1 homing weapon regression
01f1553 intended to make D1 not treat proximity mines as chaff.
Instead, it removed the test for whether the object was an acceptable
type.  As a result, all homing weapons lock onto the nearest
non-excluded object of any type, which is the homing weapon itself.  It
then flies in a straight line trying to catch itself.
2014-08-08 03:06:31 +00:00
Kp c8af6bba86 Throw on invalid homing_flag 2014-08-08 03:02:32 +00:00
Kp bb66bbbff7 Remove always-true tests 2014-07-16 03:23:14 +00:00
Kp afeaa09e9a Replace vm_copy_transpose_matrix with vm_transposed_matrix
Also, delete obsolete broken inlining support.
2014-07-14 02:17:40 +00:00
Kp 51cdce44f1 List initialize perturb_array omega blobs 2014-07-04 03:56:41 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp a2427f58b5 Use special type to reduce pointer/index conversions 2014-01-12 19:32:12 +00:00
Kp 172066f3fb Use objptridx_t in Laser_create_new 2014-01-11 17:55:32 +00:00
Kp 3bdfc28ef5 Return objptridx_t from create_weapon_object 2014-01-11 17:55:01 +00:00
Kp 9a5d0f6f09 Use symbolic values for segment/object first/none 2014-01-06 04:17:55 +00:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +00:00
Kp 745633eabe Use vector to allow rendering unlimited robots 2013-12-29 04:54:08 +00:00
Kp 0c30fa7cf3 Whitelist MAX flash missiles as valid laser type 2013-12-22 01:15:40 +00:00
Drakona 04d84ae61d Pass shot orientation with each weapon packet 2013-12-05 13:11:49 +01:00
Kp 08efe14586 Remove unused Laser_player_fire parameter harmless_flag 2013-11-28 02:12:13 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 4fcf34fdbb Make create_weapon_object static 2013-10-28 04:16:45 +00:00
Kp 7bd8ab3af1 Move similar/main/laser.c -> similar/main/laser.cpp 2013-10-20 22:49:11 +00:00
Renamed from similar/main/laser.c (Browse further)