
May or may not find it relevant to your interests:
The magic (Thanks to jk)
The weapondefs
Moderator: Moderators
I don't store the weapons in the unitdef.Forboding Angel wrote:I'm not sure I understand why you would do weapons this way (IE, not in the unitdef)? It seems grossly inefficient and difficult to maintain?
Code: Select all
return lowerkeys({
Enfield_T = Enfield_T,
K98kScope = K98kScope,
M1903Springfield = M1903Springfield,
MosinNagantPU = MosinNagantPU,
Code: Select all
return {
["K98kScope" = SniperRifleClass:New{
name = [[Karabiner 98k Scoped]],
soundStart = [[GER_K98K]],
},
["M1903Springfield"] = SniperRifleClass:New{
...},
}
Code: Select all
local LightGunClass = Weapon:New{
accuracy = 100,
collisionSize = 4,
impulseFactor = 0,
intensity = 0.25,
leadBonus = 0.5,
leadLimit = 0,
movingAccuracy = 500, --590 for 2pdr?
separation = 2,
size = 1,
soundStart = [[US_37mm]], -- move later?
stages = 50,
tolerance = 300,
turret = true,
weaponType = [[Cannon]],
}
Code: Select all
-- HE Round Class
local LightGunHEClass = Weapon:New{
edgeEffectiveness = 0.2,
explosionGenerator = [[custom:HE_Small]],
explosionSpeed = 30, -- needed?
name = [[HE Shell]],
rgbColor = [[0.5 0.5 0.0]],
soundHit = [[GEN_Explo_2]],
customparams = {
damagetype = [[explosive]],
fearaoe = 40,
fearid = 301,
},
}
-- AP Round Class
local LightGunAPClass = Weapon:New{
areaOfEffect = 5,
canattackground = false,
colormap = [[ap_colormap.png]],
edgeEffectiveness = 0.1,
explosionGenerator = [[custom:AP_Small]],
explosionSpeed = 100, -- needed?
name = [[AP Shell]],
soundHit = [[GEN_Explo_1]],
customparams = {
damagetype = [[kinetic]],
},
}
Code: Select all
-- QF 2Pdr 40mm (GBR)
local QF2Pdr40mm = LightGunClass:New{
name = [[QF 2 Pdr Mk.X]],
range = 1070,
reloadTime = 4.5,
}
Code: Select all
local QF2Pdr40mmHE = QF2Pdr40mm:New(LightGunHEClass, true):New{
areaOfEffect = 42,
weaponVelocity = 1584,
damage = {
default = 350,
},
}
local QF2Pdr40mmAP = QF2Pdr40mm:New(LightGunAPClass, true):New{
weaponVelocity = 1616,
customparams = {
armor_penetration_1000m = 45,
armor_penetration_100m = 59,
},
damage = {
default = 1105,
},
}
Code: Select all
return lowerkeys({
-- QF 2Pdr
QF2Pdr40mmHE = QF2Pdr40mmHE,
QF2Pdr40mmAP = QF2Pdr40mmAP,
}}
Yes - Its really only useful if you have weapons used by multiple units that share many attributes. In that respect it's a solution to an S44 specific problem, but I thought others might find it useful / be inspired to do something similar / just interesting to see an alternative to the CA defs.knorke wrote:Would use something like that, if not for two reasons:
-not enought similiar weapons