47 Commits

Author SHA1 Message Date
Elkien3
ac52c69f2d initial fork commit
not going to explain it all, sorry :P
2019-03-27 08:17:55 -05:00
Elkien3
45fd1d9c0f Fix burst fire weapons being destroyed when out of ammo
I copied the code for normal firing wear, it won't add wear past the maximum now.
2019-03-15 08:35:33 -05:00
Elkien3
754fb12442 fix crash when shooting player
base_dmg by istelf is nil, and if def.dmg_mult is nil it also crashes, so I gave it a default value of 1 if it's not already specified in the gun definiton.
2019-03-14 16:05:46 -05:00
Elkien3
2c8fbc70cc Revert "Big Update"
This reverts commit 6ddb4a2fababa151384c69e2e3fe873cf3172d72.
2019-03-14 16:00:13 -05:00
Elkien3
6ddb4a2fab Big Update
api.lua:
58: made reload work for mutliple types of ammunition.
76: made fire function take spread and pellet value.
89: fixed bullets falling being slightly above the crosshair.
100: fire bullets for every pellet, and do spread. doing mutiple bullets here instead of mutiple fire() keeps the sound from sounding multiple times.
165: fixed burst guns getting destroyed when empty.
159: remove splash_fire, use mutliple pellets in gun def.
198-212: pass pellet and spread defs.
205: not sure what this was, it isn't an actual method and causes crash. works fine without.
236: non-automatic weapons would only shoot once, as their interval[name] would not increase with time.
remaining lines: passing defs and giving default values.

I think the other files are fairily readable, so I won't document those changes unless needed.
2019-03-13 11:51:30 -05:00
Anand S
12daaffc35
Convert gunslinger:cheetah to automatic mode again 2019-01-18 18:20:34 +05:30
Anand S
0507fe7296
Move wear check to fire
This would allow automatic guns to respect mag size, as they bypass on_lclick
2019-01-18 18:09:25 +05:30
Anand S
3338764585
Set meta back to itemstack after modification 2019-01-18 16:56:49 +05:30
Anand S
b502dfa808
Use dtime arg passed to on_step to track time elapsed from last shot 2019-01-18 16:55:27 +05:30
Anand S
a4a1f56a9c
Add projectile particle 2019-01-15 12:48:22 +05:30
Anand S
bb074d0651
fire: Return if def is non-existent 2019-01-15 12:48:05 +05:30
Anand S
a15ad27f9c
Rename style_of_fire to mode; add new firing mode for bolt-action guns
Also rename firing modes for factual accuracy
2019-01-13 21:50:59 +05:30
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