Skip to content

Commit

Permalink
Make the peewee weapon a shotgun laser with railgun effect
Browse files Browse the repository at this point in the history
Fix peewee firing animation so that smoke comes from the correct barrel
Add shotgun sound for peewee
  • Loading branch information
ForbodingAngel committed Aug 16, 2016
1 parent 14b3ad4 commit 5ebe36c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 24 deletions.
8 changes: 4 additions & 4 deletions Gamedata/explosions/railgun.lua
Expand Up @@ -15,10 +15,10 @@ return {
emitvector = [[0, 0, 0]],
gravity = [[0, 0, 0]],
numparticles = 1,
particlelife = 60,
particlelifespread = 20,
particlesize = [[2]],
particlesizespread = 10,
particlelife = 10,
particlelifespread = 5,
particlesize = [[1]],
particlesizespread = 5,
particlespeed = 1,
particlespeedspread = 6,
pos = [[0, 0, 0]],
Expand Down
11 changes: 11 additions & 0 deletions Gamedata/sounds.lua
Expand Up @@ -14,6 +14,17 @@ local Sounds = {
maxconcurrent = 8,
},

ehbotpeeweeshotgun = {
--- new since 89.0
--- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound)
file = "sounds/shotgun-reload.wav",
gainmod = 0.35,
pitchmod = 0.05,
--pitch = 0.7,
in3d = true,
maxconcurrent = 16,
},

nukeartyweaponhit = {
--- new since 89.0
--- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound)
Expand Down
2 changes: 1 addition & 1 deletion Scripts/ehbotpeewee_lus.lua
Expand Up @@ -48,8 +48,8 @@ function script.QueryWeapon(weaponID)
end

function script.FireWeapon(weaponID)
EmitSfx (firepoints[currentFirepoint], 1024)
currentFirepoint = 3 - currentFirepoint
EmitSfx (firepoints[currentFirepoint], 1024)
end

function script.AimWeapon(weaponID, heading, pitch)
Expand Down
2 changes: 1 addition & 1 deletion Scripts/headers/common_includes_lus.lua
Expand Up @@ -9,7 +9,7 @@ common = {

HbotLift = function ()
Move(base, y_axis, 20, 200)
Spring.Echo("Bruh I lift")
--Spring.Echo("Bruh I lift")
end,

setSFXoccupy = function (setSFXoccupy_argument)
Expand Down
41 changes: 23 additions & 18 deletions Units/ehbot/ehbotpeewee.lua
Expand Up @@ -11,7 +11,8 @@ local supply = [[3]]

local weapon1Damage = 5
local weapon1AOE = 100
local energycosttofire = weapon1Damage / 10 * ((weapon1AOE / 1000) + 1)
local projectiles = 5
local energycosttofire = weapon1Damage / 10 * projectiles * ((weapon1AOE / 1000) + 1)

local function roundToFirstDecimal(energycosttofire)
return math.floor(energycosttofire*10 + 0.5)*0.1
Expand All @@ -24,7 +25,7 @@ local unitDef = {
--**

acceleration = 1,
brakeRate = 0.1,
brakeRate = 1,
buildCostEnergy = 0,
buildCostMetal = 27,
builder = false,
Expand All @@ -38,16 +39,8 @@ local unitDef = {
canstop = "1",
category = "LIGHT NOTAIR RAID",
corpse = "ammobox",
description = [[Unit Type: Raider
Armortype: ]] ..armortype.. [[
45 Damage vs Light/Armored
60 Damage vs Building
Energy cost to fire: ]] .. roundToFirstDecimal(energycosttofire) .. [[
Requires +]] .. power .. [[
Uses +]] .. supply .. [[ Supply]],
description = [[Light Raider
Requires +]] .. power .. [[ and Uses +]] .. supply .. [[ Supply]],
energyMake = 0,
energyStorage = 0,
energyUse = 0,
Expand Down Expand Up @@ -127,7 +120,12 @@ Uses +]] .. supply .. [[ Supply]],
normaltex = "unittextures/lego2skin_explorernormal.dds",
buckettex = "unittextures/lego2skin_explorerbucket.dds",
factionname = "outer_colonies",
helptext = [[]],
helptext = [[Armortype: ]] ..armortype.. [[
45 Damage vs Light/Armored
60 Damage vs Building
Energy cost to fire: ]] .. roundToFirstDecimal(energycosttofire),
},
}

Expand All @@ -139,19 +137,26 @@ local weaponDefs = {
flashweapon = {
AreaOfEffect = weapon1AOE,
avoidFriendly = false,
avoidFeature = false,
collideFriendly = false,
rgbColor = "0.8 0.5 0",
rgbColor2 = "0.5 0.5 0.5",
collideFeature = false,
cegTag = "railgun",
rgbColor = "0 0 1",
rgbColor2 = "1 1 1",
explosionGenerator = "custom:genericshellexplosion-medium-sparks-burn",
energypershot = energycosttofire,
duration = 0.25,
name = "E.M.G.",
noExplode = true,
range = 600,
reloadtime = 0.5,
projectiles = 5,
weaponType = "Cannon",
soundStart = "tgunshipfire.wav",
projectiles = projectiles,
weaponType = "LaserCannon",
soundStart = "shotgun-reload.wav",
soundTrigger = true,
sprayAngle = 2000,
texture1 = "shot",
texture2 = "empty",
tolerance = 10000,
turret = true,
weaponTimer = 1,
Expand Down
Binary file added sounds/shotgun-reload.wav
Binary file not shown.

0 comments on commit 5ebe36c

Please sign in to comment.