Rename: LMB, RMB to dig, place

master
Coder12a 2020-10-08 21:31:46 -05:00
parent 6557348eb9
commit 12de38ed9a
8 changed files with 37 additions and 36 deletions

View File

@ -19,9 +19,9 @@ Double tap use key to dodge. **(Requires sscsm)**
#### blocking
Using any tool that can damage. Press RMB *(Right mouse button or double tap)* key to activate the tool block.
Using any tool that can damage. Press place *(Right mouse button or double tap)* key to activate the tool block.
Holding down RMB after activating will maintain the block.
Holding down place after activating will maintain the block.
Be careful though tool blocking has a guard pool taking damage reduces it on till the guard breaks and you must re-activate the tool block or risk-taking damage.
@ -29,13 +29,13 @@ Be careful though tool blocking has a guard pool taking damage reduces it on til
Same as tool blocking but shields have a bigger guard pool and can cover 270 degrees around the player. **(Requires shields from 3d_armor)**
sneak key + RMB will block using the shield in the armor inventory. **(Requires shields from 3d_armor)**
sneak key + place will block using the shield in the armor inventory. **(Requires shields from 3d_armor)**
#### throwing
To throw a tool hold down either LMB or RMB and then press the drop key to start charging up the toss.
To throw a tool hold down either dig or place and then press the drop key to start charging up the toss.
When you are ready to throw release either LMB or RMB.
When you are ready to throw release either dig or place.
All tools have different throw speeds, charge times, and damages.
@ -45,7 +45,7 @@ All tools have different throw speeds, charge times, and damages.
**/tap_speed_reset** [none] Resets the tap sensitivity to 0.15 seconds. **(Requires sscsm)**
**/use_shield** [boolean] If set to true, the shield plate inside your armor inventory will be used to block all incoming damage when RMB is pressed. **(Requires shields)**
**/use_shield** [boolean] If set to true, the shield plate inside your armor inventory will be used to block all incoming damage when place is pressed. **(Requires shields)**
**/move_item** Gives you a movement item. Accepted values are:
- dodge

View File

@ -1,3 +1,5 @@
pvp_revamped.projectile_throw_style_dip = 1
pvp_revamped.projectile_throw_style_spinning = 2
pvp_revamped.point_torso = 0
pvp_revamped.point_arm = 1
pvp_revamped.use_player_api = minetest.global_exists("player_api")

View File

@ -4,5 +4,5 @@ pvp_revamped.armor_3d = minetest.global_exists("armor")
pvp_revamped.player_data = {}
pvp_revamped.player_persistent_data = {}
pvp_revamped.hit_points = {{x = 0.3, y = 1.2, z = 0, part = 1},
{x = 0, y = 1.2, z = 0, part = 0},
{x = -0.3, y = 1.2, z = 0, part = 1}}
{x = 0, y = 1.2, z = 0, part = pvp_revamped.point_torso},
{x = -0.3, y = 1.2, z = 0, part = pvp_revamped.point_arm}}

View File

@ -45,7 +45,7 @@ minetest.register_globalstep(function(dtime)
local active
if v.block and v.aim then
-- Check if the player is holding down the RMB key.
-- Check if the player is holding down the place key.
if floor(player:get_player_control_bits() / 256) % 2 == 1 then
-- Update the block time.
v.block.time = time
@ -76,7 +76,7 @@ minetest.register_globalstep(function(dtime)
end
if v.shield and v.entity then
-- Check if the player is holding down the RMB key.
-- Check if the player is holding down the place key.
if floor(player:get_player_control_bits() / 256) % 2 == 1 then
-- Update the shield time.
v.shield.time = time
@ -116,7 +116,7 @@ minetest.register_globalstep(function(dtime)
local tool_capabilities = throw_data.tool_capabilities
local full_throw = throw_data.time + tool_capabilities.full_throw
-- If neither LMB or RMB is down then throw the item.
-- If neither dig or place is down then throw the item.
if (floor(control_bits / 128) % 2 ~= 1 and floor(control_bits / 256) % 2 ~= 1) or pp_data.active_dodges or pp_data.active_barrel_rolls then
local pos = player:get_pos()

View File

@ -123,8 +123,8 @@ minetest.register_globalstep(function(dtime)
timer = 0
end
-- sneak + RMB = armor inv shield block.
if (not last_control.sneak or not last_control.RMB) and control.sneak and control.RMB then
-- sneak + place = armor inv shield block.
if (not last_control.sneak or not last_control.place) and control.sneak and control.place then
com_send("pvp_revamped:shield_block", "block")
end

View File

@ -169,7 +169,7 @@ minetest.register_on_mods_loaded(function()
local throw_data = data.throw
local shield_data = data.shield
-- If in the process of throwing, either LMB, RMB, or item name is not the same then return the old function.
-- If in the process of throwing, either dig, place, or item name is not the same then return the old function.
if throw_data or dropper:get_wielded_item():get_name() ~= name or (floor(control_bits / 128) % 2 ~= 1 and floor(control_bits / 256) % 2 ~= 1) then
return old_on_drop(itemstack, dropper, pos)
end

View File

@ -31,6 +31,7 @@ local armor_3d = pvp_revamped.armor_3d
local hit_points = pvp_revamped.hit_points
local create_hud_text_center = pvp_revamped.create_hud_text_center
local remove_text_center = pvp_revamped.remove_text_center
local point_arm = pvp_revamped.point_arm
local registered_tools = minetest.registered_tools
local raycast = minetest.raycast
local get_us_time = minetest.get_us_time
@ -180,7 +181,7 @@ local function punch(player, hitter, time_from_last_punch, tool_capabilities, di
end
end
if near_part == 1 then
if near_part == point_arm then
-- Hit in the arm.
arm = true
@ -547,7 +548,7 @@ local function punch(player, hitter, time_from_last_punch, tool_capabilities, di
if not hd.resolved and hd.name == name then
if floor(hitter:get_player_control_bits() / 256) % 2 == 1 then
-- Attempt to parry the attack if RMB is down.
-- Attempt to parry the attack if place is down.
local parry_dmg_mul = tool_capabilities.parry_dmg_mul or parry_dmg_mul
local clash_def_mul = tool_capabilities.clash_def_mul or 0
local c_damage = damage * clash_def_mul

View File

@ -31,17 +31,15 @@ sscsm.register({name = "pvp_revamped:movement",
-- Channel for dodge request.
sscsm.register_on_com_receive("pvp_revamped:dodge", function(name, msg)
if msg and type(msg) == "string" and msg == "dodge" then
local player = get_player_by_name(name)
local velocity = player:get_player_velocity().y
local aerial_points = 0
local player = get_player_by_name(name)
local velocity = player:get_player_velocity().y
local aerial_points = 0
if velocity < 0.0 or velocity > 0.0 then
aerial_points = 1
end
dodge(name, player, 1 + aerial_points)
if velocity < 0.0 or velocity > 0.0 then
aerial_points = 1
end
dodge(name, player, 1 + aerial_points)
end)
-- Channel for barrel_roll request.
@ -96,15 +94,15 @@ sscsm.register_on_com_receive("pvp_revamped:dash", function(name, msg)
end
end)
-- Channel for shield_block request.
if minetest.global_exists("armor") then
sscsm.register_on_com_receive("pvp_revamped:shield_block", function(name, msg)
if msg and type(msg) == "string" then
local data = get_player_data(name)
local player = get_player_by_name(name)
local player_pdata = player_persistent_data[name]
shield_inv(player, name, player_pdata, data)
end
end)
if not minetest.global_exists("armor") then
return
end
-- Channel for shield_block request.
sscsm.register_on_com_receive("pvp_revamped:shield_block", function(name, msg)
local data = get_player_data(name)
local player = get_player_by_name(name)
local player_pdata = player_persistent_data[name]
shield_inv(player, name, player_pdata, data)
end)