35 Commits

Author SHA1 Message Date
Anand S
9faeb35e44
Separate reload from on_lclick again
Allows calling reload arbitrarily by the API.
2019-01-13 21:47:49 +05:30
Anand S
1afd0ca267
Define default gunshot sound during gun registration itself
Every minor optimisation matters :)
2019-01-13 12:38:15 +05:30
Anand S
2b7de3cc9d
fire(): Play gunslinger_fire2 sound for guns with splash style of fire 2019-01-13 12:13:40 +05:30
Anand S
b23f5fa2de
fire(): Return before declaring def, if stack is nil 2019-01-13 12:09:19 +05:30
Anand S
40fa0fd4ca
Add missing parenthesis to os.time in on_lclick 2019-01-07 15:11:33 +05:30
Anand S
e60d5aa896
register_gun: Fix inverse condition when checking for lite mode 2019-01-06 11:38:40 +05:30
Anand S
087902f2ac
Tweak and optimise add_auto and on_step 2019-01-05 07:47:29 +05:30
Anand S
34b2ba9f90
Make on_lclick and on_step respect gun's fire_rate 2019-01-05 07:37:52 +05:30
Anand S
231f3498fd
Fix incorrect condition evaluated to register on_step 2019-01-05 07:04:12 +05:30
Anand S
b21c47a6e3
Prepare for pre-release 2019-01-04 20:24:34 +05:30
Anand S
0f42c5153c
Add zoom, simplify scopes
- Don't differentiate between scoes and sights.
- Allow all scopes to be zoomable.
- `scope` field takes name of scope overlay texture.
2019-01-04 19:44:26 +05:30
Anand S
d8cee030a3
Rename gunslinger.enable_automatic to gunslinger.lite
Make it more generic, and document it in README.md
2019-01-04 18:36:51 +05:30
Anand S
db1bc18fbf
Return if def == nil in fire() 2019-01-04 15:53:35 +05:30
Anand S
47295009cd
Fix incorrect interval passed to minetest.after in burst mode 2019-01-04 15:53:06 +05:30
Anand S
4c00ffd228
Merge reload into on_lclick 2019-01-04 13:37:02 +05:30
Anand S
ba6bfea7a6
Register globalstep only if automatic guns have been enabled 2019-01-03 17:10:54 +05:30
Anand S
468f199f77
Implement burst mode 2019-01-02 21:27:54 +05:30
Anand S
2f1b35fd23
Improve error message when registering auto guns 2018-12-29 17:15:28 +05:30
Anand S
ae589e185e
Improve wear mechanism 2018-12-28 17:26:48 +05:30
Anand S
a766dd7058 Fix accidental swap of if-else blocks in "semi-automatic" 2018-11-27 21:18:12 +05:30
Anand S
8fcc38d609 Fix missing namespace in function call 2018-11-27 20:50:47 +05:30
Anand S
2a5bf40509 Add setting to optionally disable automatic guns 2018-11-27 16:07:21 +05:30
Anand S
f626853804 Add helper function add_auto 2018-11-27 15:28:41 +05:30
Anand S
b58e6d481c on_step: Add time checks to respect fire-rate of gun 2018-11-27 15:13:35 +05:30
Anand S
6d3bfd204e Actually set stack after modification in on_step 2018-11-27 15:10:19 +05:30
Anand S
bf6ac0c5f7 Implement firing of semi-auto weapons 2018-11-27 14:55:07 +05:30
Anand S
e3527bed2f Use hard-coded eye-height for now; rename field in gun def 2018-11-24 15:17:48 +05:30
Anand S
fa8a153cb5 Relocate gunshot sound to top of fire() 2018-11-24 13:42:39 +05:30
Anand S
c2e500315b Import type table into gun def; Make types optional 2018-11-23 22:43:02 +05:30
Anand S
408abbc260 Add per-gun firing range 2018-11-23 22:09:28 +05:30
Anand S
8860fd92d0 Only pass the required params to show_scope instead of the full gun def 2018-11-23 22:07:02 +05:30
Anand S
18b1f42cb8 Don't re-add to automatic if entry exists 2018-11-23 22:07:02 +05:30
Anand S
30e8cea45c Clean up and re-arrange API methods 2018-11-23 22:06:58 +05:30
Anand S
6de402af44 Add API support for gunshot sound 2018-11-20 15:10:33 +05:30
Anand S
2659d195a1 Add standalone API 2018-11-20 14:00:33 +05:30