77 Commits

Author SHA1 Message Date
Elkien3
1e8284beb2 fix crash while trying to load with only empty mag in inv 2019-08-06 22:39:21 -05:00
Elkien3
74204e154f add support for my version of binoculars 2019-07-28 11:11:18 -05:00
Elkien3
0b5971f2d2 fix automatic weapons not firing right away 2019-05-13 13:32:54 -05:00
Elkien3
a6336bc316 add invisible texture 2019-05-03 08:33:09 -05:00
Elkien3
be585fc38d add smoke and muzzle flash 2019-05-03 08:24:31 -05:00
Elkien3
651c3a94a8 fix being able to shoot through doors 2019-05-03 08:10:09 -05:00
Elkien3
44930f75ea move where recoil is added 2019-04-25 13:22:19 -05:00
Elkien3
905bcc5b6e fix sound not attached to dropper 2019-04-24 16:05:23 -05:00
Elkien3
cab493267c prevent it from duplicating 2019-04-14 11:08:48 -05:00
Elkien3
4067683794 make guns and magazines not repairable by technic MV workshop 2019-04-13 08:08:05 -05:00
Elkien3
8488f2c32b fix player shooting while dead 2019-04-12 11:40:23 -05:00
Elkien3
269bebaf0d fix wear duping 2019-04-12 11:36:44 -05:00
Elkien3
90ccff46fa fix guns duping
you could start shooting a automatic gun and scroll around the hotbar and it would copy the gun
2019-04-12 11:33:01 -05:00
Elkien3
61f3412285 add sounds for reoading 2019-04-10 15:59:20 -05:00
Elkien3
d5b5e46237 fix being able to shoot yourself in the foot 2019-03-27 10:42:00 -05:00
Elkien3
b311f4e92f more helper stuff 2019-03-27 08:28:37 -05:00
Elkien3
a1276a6dfb update the api helper 2019-03-27 08:23:25 -05:00
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
7cfa7e4412
guns.lua: Make cheetah fire in burst mode 2019-01-15 10:48:52 +05:30
Anand S
8ffa07307e
Rename invalid field in definition of gunslinger:cheetah 2019-01-15 09:51:09 +05:30
Anand S
d857b786ee
API.md: Improve documentation of burst mode 2019-01-14 16:14:08 +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
37d175f381
Document gunslinger.disable_builtin setting 2019-01-06 11:52:08 +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
9992816356
Add mod.conf 2019-01-05 07:57:26 +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