Skip to content

Commit 7bd1d44

Browse files
committed
Fire weapon
1 parent 2e994fa commit 7bd1d44

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

library/character.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,5 @@
33
---@class Character
44
local Character = {}
55

6-
---@class Position
7-
---@field x number
8-
---@field y number
9-
106
---@return Position pos the floating point position of a tee in the world
117
function Character:pos() end

library/ddnetpp.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
---You have to return the `msg` from the function!
5454
---@field on_chat fun(client_id: integer, msg: ChatMessage): ChatMessage
5555
---
56+
---You can return false from this method to block the shot.
57+
---@field on_fire_weapon fun(client_id: integer, weapon: integer, direction: Vec2, mouse_target: Vec2, projectile_start_pos: Position): false|nil
58+
---
5659
---The client_id is the client that will receive the message
5760
---and data is the raw data that is being sent
5861
---return true to drop the message and abort sending it.

library/vmath.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---@meta
2+
3+
---@class Position
4+
---@field x number
5+
---@field y number
6+
7+
---@class Velocity
8+
---@field x number
9+
---@field y number
10+
11+
---@class Vec2
12+
---@field x number
13+
---@field y number

0 commit comments

Comments
 (0)