Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Chalwk77 committed Jul 8, 2023
1 parent 3962cfe commit 0d0c453
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 115 deletions.
2 changes: 1 addition & 1 deletion INDEV/Battle Royale/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Planned features:
- [x] Weapon parts (for weapon repair system)
- [x] Ammo (different types)
- [ ] Weapons (different types)
- [ ] Grenade launcher
- [x] Grenade launcher
- [x] Health boost (50%, 100%, 150%, 200%)
- [x] Speed boost (1.2, 1.3, 1.4, 1.5)
- [x] Sky spawn system:
Expand Down
8 changes: 5 additions & 3 deletions INDEV/Battle Royale/events/on_object_spawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ function event:onObjectSpawn(player, map_id, parent_id, object_id, sapp_spawning
-- not currently used
end

local dyn = get_dynamic_player(player.id)
local dyn = get_dynamic_player(player)
if (player > 0 and dyn ~= 0) then
player = self.players[player]

local this_weapon = read_dword(dyn + 0x118)
local object = get_object_memory(this_weapon)

local weapon = self:getWeapon(object)
if (weapon and weapon.ammo_type == 3) then
return false, player:createExplosiveBullet(dyn)
if (not weapon) then
return
elseif (weapon.ammo_type == 3 or weapon.ammo_type == 5) then
return false, player:createProjectile(dyn, weapon)
end
end

Expand Down
1 change: 1 addition & 0 deletions INDEV/Battle Royale/events/on_start.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function event:onStart()
self.weapons = {}

self.rocket_projectile = self:getTag('proj', 'weapons\\rocket launcher\\rocket')
self.frag_projectile = self:getTag('proj', 'weapons\\frag grenade\\frag grenade')

self.loot = nil
self.loot_crates = nil
Expand Down
33 changes: 32 additions & 1 deletion INDEV/Battle Royale/loot/spoils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,31 @@ function spoils:giveStunGrenades(args)
end

function spoils:giveGrenadeLauncher(args)
self:newMessage('You unlocked ' .. args.label, 5)

local id = self.id

local dyn = get_dynamic_player(id)
local this_weapon = read_dword(dyn + 0x118)
if (this_weapon == 0xFFFFFFFF) then
self:newMessage('Picked up grenade launcher but no weapon to modify!', 5)
return true
end

local object = get_object_memory(this_weapon)
if (object ~= 0) then

local weapon = self:getWeapon(object)
weapon.velocity = args.velocity
weapon.distance = args.distance
weapon.projectile = self.frag_projectile

weapon:setAmmoType(5)
weapon:setAmmoDamage(100)

self:newMessage('You unlocked ' .. args.label)
return true
end
return false
end

function spoils:giveWeaponParts(args)
Expand Down Expand Up @@ -73,6 +97,13 @@ function spoils:giveAmmo(args)
if (object ~= 0) then

local weapon = self:getWeapon(object)

--- for explosive bullets:
weapon.velocity = 10
weapon.distance = 0.5
weapon.projectile = self.rocket_projectile
--

weapon:setAmmoType(type)
weapon:setAmmoDamage(multiplier)

Expand Down
13 changes: 11 additions & 2 deletions INDEV/Battle Royale/map settings/bloodgulch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ return {
--- Spoils found in loot crates:
-- Format: [chance] = { label = 'Spoil label (seen in game)' }
-- To disable a spoil, set its chance to 0.
-- [!] Do not touch the '_function__' value. It is used internally.
-- [!] Do not touch the '_function_' value. It is used internally.
--
spoils = {

Expand Down Expand Up @@ -248,8 +248,17 @@ return {
},

--- GRENADE LAUNCHER:
-- Turns any weapon into a grenade launcher.
[20] = {

label = 'Grenade Launcher',

-- How far (in world units) in front of the the player the frag will spawn:
distance = 1.5,

-- Grenade launcher projectile velocity:
velocity = 0.6,

_function_ = 'giveGrenadeLauncher'
},

Expand Down Expand Up @@ -281,7 +290,7 @@ return {
-- * 3 = explosive bullets
-- * 4 = golden bullets (one-shot kill)
-- Format: { [type] = {multiplier, label}, ...}
[100000] = {
[40] = {
types = {
[1] = { 0, '$ammoX normal bullets' },
[2] = { 1.5, '$ammoX armour piercing bullets' },
Expand Down
50 changes: 36 additions & 14 deletions INDEV/Battle Royale/map settings/dangercanyon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,16 @@ return {

-- Format: ['tag name'] = weight reduction value
weapons = {

['weapons\\flag\\flag'] = 0.028,
['weapons\\ball\\ball'] = 0.028,

['weapons\\pistol\\pistol'] = 0.036,
['weapons\\plasma pistol\\plasma pistol'] = 0.036,

['weapons\\needler\\mp_needler'] = 0.042,
['weapons\\plasma rifle\\plasma rifle'] = 0.042,

['weapons\\shotgun\\shotgun'] = 0.047,
['weapons\\assault rifle\\assault rifle'] = 0.061,

['weapons\\flamethrower\\flamethrower'] = 0.073,

['weapons\\sniper rifle\\sniper rifle'] = 0.075,

['weapons\\plasma_cannon\\plasma_cannon'] = 0.098,
['weapons\\rocket launcher\\rocket launcher'] = 0.104
}
Expand Down Expand Up @@ -206,18 +199,13 @@ return {
-- The frequency of jamming is: (durability / 100) ^ 2 * 100
--
decay_rate = {

['weapons\\plasma pistol\\plasma pistol'] = 1.0,
['weapons\\plasma rifle\\plasma rifle'] = 1.2,

['weapons\\assault rifle\\assault rifle'] = 1.4,

['weapons\\pistol\\pistol'] = 4.10,
['weapons\\needler\\mp_needler'] = 4.20,

['weapons\\flamethrower\\flamethrower'] = 7.05,
['weapons\\shotgun\\shotgun'] = 8.0,

['weapons\\sniper rifle\\sniper rifle'] = 23.0,
['weapons\\plasma_cannon\\plasma_cannon'] = 25.0,
['weapons\\rocket launcher\\rocket launcher'] = 40.0,
Expand All @@ -227,6 +215,7 @@ return {

--- Loot:
-- The loot system will spawn items at pre-defined locations.
-- [!] These locations may be randomised in a later update.
--
looting = {

Expand All @@ -235,7 +224,7 @@ return {
--- Spoils found in loot crates:
-- Format: [chance] = { label = 'Spoil label (seen in game)' }
-- To disable a spoil, set its chance to 0.
-- [!] Do not touch the '_function__' value. It is used internally.
-- [!] Do not touch the '_function_' value. It is used internally.
--
spoils = {

Expand Down Expand Up @@ -265,8 +254,17 @@ return {
},

--- GRENADE LAUNCHER:
-- Turns any weapon into a grenade launcher.
[20] = {

label = 'Grenade Launcher',

-- How far (in world units) in front of the the player the frag will spawn:
distance = 1.5,

-- Grenade launcher projectile velocity:
velocity = 0.6,

_function_ = 'giveGrenadeLauncher'
},

Expand All @@ -291,8 +289,32 @@ return {
},

--- AMMO:
-- When you pick up custom ammo, you will receive 1 clip of that ammo type.
-- Ammo types:
-- * 1 = normal bullets
-- * 2 = armour piercing bullets
-- * 3 = explosive bullets
-- * 4 = golden bullets (one-shot kill)
-- Format: { [type] = {multiplier, label}, ...}
[40] = {
label = 'Ammo',
types = {
[1] = { 0, '$ammoX normal bullets' },
[2] = { 1.5, '$ammoX armour piercing bullets' },
[3] = { 5, '$ammoX explosive bullets' },
[4] = { 100, '$ammoX golden bullets' }
},
clip_sizes = {
['weapons\\plasma pistol\\plasma pistol'] = 100,
['weapons\\plasma rifle\\plasma rifle'] = 100,
['weapons\\assault rifle\\assault rifle'] = 60,
['weapons\\pistol\\pistol'] = 12,
['weapons\\needler\\mp_needler'] = 20,
['weapons\\flamethrower\\flamethrower'] = 100,
['weapons\\shotgun\\shotgun'] = 12,
['weapons\\sniper rifle\\sniper rifle'] = 4,
['weapons\\plasma_cannon\\plasma_cannon'] = 100,
['weapons\\rocket launcher\\rocket launcher'] = 2
},
_function_ = 'giveAmmo'
},

Expand Down
50 changes: 36 additions & 14 deletions INDEV/Battle Royale/map settings/deathisland.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,16 @@ return {

-- Format: ['tag name'] = weight reduction value
weapons = {

['weapons\\flag\\flag'] = 0.028,
['weapons\\ball\\ball'] = 0.028,

['weapons\\pistol\\pistol'] = 0.036,
['weapons\\plasma pistol\\plasma pistol'] = 0.036,

['weapons\\needler\\mp_needler'] = 0.042,
['weapons\\plasma rifle\\plasma rifle'] = 0.042,

['weapons\\shotgun\\shotgun'] = 0.047,
['weapons\\assault rifle\\assault rifle'] = 0.061,

['weapons\\flamethrower\\flamethrower'] = 0.073,

['weapons\\sniper rifle\\sniper rifle'] = 0.075,

['weapons\\plasma_cannon\\plasma_cannon'] = 0.098,
['weapons\\rocket launcher\\rocket launcher'] = 0.104
}
Expand Down Expand Up @@ -221,18 +214,13 @@ return {
-- The frequency of jamming is: (durability / 100) ^ 2 * 100
--
decay_rate = {

['weapons\\plasma pistol\\plasma pistol'] = 1.0,
['weapons\\plasma rifle\\plasma rifle'] = 1.2,

['weapons\\assault rifle\\assault rifle'] = 1.4,

['weapons\\pistol\\pistol'] = 4.10,
['weapons\\needler\\mp_needler'] = 4.20,

['weapons\\flamethrower\\flamethrower'] = 7.05,
['weapons\\shotgun\\shotgun'] = 8.0,

['weapons\\sniper rifle\\sniper rifle'] = 23.0,
['weapons\\plasma_cannon\\plasma_cannon'] = 25.0,
['weapons\\rocket launcher\\rocket launcher'] = 40.0,
Expand All @@ -242,6 +230,7 @@ return {

--- Loot:
-- The loot system will spawn items at pre-defined locations.
-- [!] These locations may be randomised in a later update.
--
looting = {

Expand All @@ -250,7 +239,7 @@ return {
--- Spoils found in loot crates:
-- Format: [chance] = { label = 'Spoil label (seen in game)' }
-- To disable a spoil, set its chance to 0.
-- [!] Do not touch the '_function__' value. It is used internally.
-- [!] Do not touch the '_function_' value. It is used internally.
--
spoils = {

Expand Down Expand Up @@ -280,8 +269,17 @@ return {
},

--- GRENADE LAUNCHER:
-- Turns any weapon into a grenade launcher.
[20] = {

label = 'Grenade Launcher',

-- How far (in world units) in front of the the player the frag will spawn:
distance = 1.5,

-- Grenade launcher projectile velocity:
velocity = 0.6,

_function_ = 'giveGrenadeLauncher'
},

Expand All @@ -306,8 +304,32 @@ return {
},

--- AMMO:
-- When you pick up custom ammo, you will receive 1 clip of that ammo type.
-- Ammo types:
-- * 1 = normal bullets
-- * 2 = armour piercing bullets
-- * 3 = explosive bullets
-- * 4 = golden bullets (one-shot kill)
-- Format: { [type] = {multiplier, label}, ...}
[40] = {
label = 'Ammo',
types = {
[1] = { 0, '$ammoX normal bullets' },
[2] = { 1.5, '$ammoX armour piercing bullets' },
[3] = { 5, '$ammoX explosive bullets' },
[4] = { 100, '$ammoX golden bullets' }
},
clip_sizes = {
['weapons\\plasma pistol\\plasma pistol'] = 100,
['weapons\\plasma rifle\\plasma rifle'] = 100,
['weapons\\assault rifle\\assault rifle'] = 60,
['weapons\\pistol\\pistol'] = 12,
['weapons\\needler\\mp_needler'] = 20,
['weapons\\flamethrower\\flamethrower'] = 100,
['weapons\\shotgun\\shotgun'] = 12,
['weapons\\sniper rifle\\sniper rifle'] = 4,
['weapons\\plasma_cannon\\plasma_cannon'] = 100,
['weapons\\rocket launcher\\rocket launcher'] = 2
},
_function_ = 'giveAmmo'
},

Expand Down
Loading

0 comments on commit 0d0c453

Please sign in to comment.