diff --git a/.vscode/fa-plugin.lua b/.vscode/fa-plugin.lua new file mode 100644 index 0000000000..02fcebb425 --- /dev/null +++ b/.vscode/fa-plugin.lua @@ -0,0 +1,28 @@ +---@class diff +---@field start integer # The number of bytes at the beginning of the replacement +---@field finish integer # The number of bytes at the end of the replacement +---@field text string # What to replace + +---@param uri string # The uri of file +---@param text string # The content of file +---@return nil|diff[] +function OnSetText(uri, text) + local diffs = {} + + local pos = text:match('^%s*()#') + if pos ~= nil then + diffs[#diffs + 1] = { + start = pos, + finish = pos, + text = '--' + } + end + for pos in text:gmatch '\r\n%s*()#' do + diffs[#diffs + 1] = { + start = pos, + finish = pos, + text = '--' + } + end + return diffs +end diff --git a/.vscode/settings.json b/.vscode/settings.json index 13ee2b0418..2bb6adb044 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,33 @@ { - "nuxt.isNuxtApp": false -} \ No newline at end of file + "Lua.runtime.nonstandardSymbol": [ + "continue", + "!=" + ], + "Lua.completion.showWord": "Disable", + "Lua.runtime.special": { + "import": "require", + "doscript": "require" + }, + "Lua.runtime.version": "Lua 5.1", + "Lua.telemetry.enable": false, + "Lua.workspace.checkThirdParty": false, + "Lua.runtime.path": [ + "/?" + ], + "Lua.runtime.plugin": ".vscode/fa-plugin.lua", + "Lua.workspace.ignoreDir": [ + ".vscode", + "loc", + ], + "[lua]": { + "editor.wordBasedSuggestions": false, + }, + "Lua.completion.requireSeparator": "/", + "Lua.diagnostics.enable": true, + "Lua.runtime.pathStrict": false, + "Lua.runtime.exportEnvDefault": true, + "Lua.completion.autoRequire": false, + "Lua.diagnostics.globals": [ + "ScenarioInfo" + ], +} diff --git a/engine/BlueprintCategories.lua b/engine/BlueprintCategories.lua new file mode 100644 index 0000000000..ce9be0eb68 --- /dev/null +++ b/engine/BlueprintCategories.lua @@ -0,0 +1,218 @@ +---@meta +---@declare-global + +--- dummy value just so we have something to assign the categories to +---@alias CategorieType userdata +---@type CategorieType +local categoryValue + +---@class Categories : table +categories = { + ABILITYBUTTON = categoryValue, + ADVANCEDCOMBATPRESET = categoryValue, + AEON = categoryValue, + AIR = categoryValue, + AIRSTAGINGPLATFORM = categoryValue, + ALLPROJECTILES = categoryValue, + ALLUNITS = categoryValue, + AMPHIBIOUS = categoryValue, + ANTIAIR = categoryValue, + ANTIAIRPRESET = categoryValue, + ANTIMISSILE = categoryValue, + ANTINAVY = categoryValue, + ANTISHIELD = categoryValue, + ANTISUB = categoryValue, + ANTITORPEDO = categoryValue, + ARTILLERY = categoryValue, + ASF = categoryValue, + BATTLESHIP = categoryValue, + BENIGN = categoryValue, + BOMB = categoryValue, + BOMBER = categoryValue, + BOT = categoryValue, + BUBBLESHIELDPRESET = categoryValue, + BUBBLESHIELDSPILLOVERCHECK = categoryValue, + BUILTBYAIRTIER2FACTORY = categoryValue, + BUILTBYAIRTIER3FACTORY = categoryValue, + BUILTBYCOMMANDER = categoryValue, + BUILTBYEXPERIMENTALSUB = categoryValue, + BUILTBYLANDTIER2FACTORY = categoryValue, + BUILTBYLANDTIER3FACTORY = categoryValue, + BUILTBYNAVALTIER2FACTORY = categoryValue, + BUILTBYNAVALTIER3FACTORY = categoryValue, + BUILTBYQUANTUMGATE = categoryValue, + BUILTBYTIER1ENGINEER = categoryValue, + BUILTBYTIER1FACTORY = categoryValue, + BUILTBYTIER2COMMANDER = categoryValue, + BUILTBYTIER2ENGINEER = categoryValue, + BUILTBYTIER2FACTORY = categoryValue, + BUILTBYTIER2SUPPORTFACTORY = categoryValue, + BUILTBYTIER3COMMANDER = categoryValue, + BUILTBYTIER3ENGINEER = categoryValue, + BUILTBYTIER3FACTORY = categoryValue, + CANNOTUSEAIRSTAGING = categoryValue, + CANTRANSPORTCOMMANDER = categoryValue, + CAPTURE = categoryValue, + CARRIER = categoryValue, + CIVILIAN = categoryValue, + CIVILLIAN = categoryValue, + CLOAKPRESET = categoryValue, + COMBATPRESET = categoryValue, + COMMAND = categoryValue, + CONSTRUCTION = categoryValue, + CONSTRUCTIONSORTDOWN = categoryValue, + COUNTERINTELLIGENCE = categoryValue, + CQUEMOV = categoryValue, + CRABEGG = categoryValue, + CRUISER = categoryValue, + CYBRAN = categoryValue, + DEBUG = categoryValue, + DEFENSE = categoryValue, + DEFENSIVEBOAT = categoryValue, + DESTROYER = categoryValue, + DIESTOOCDEPLETINGSHIELD = categoryValue, + DIRECTFIRE = categoryValue, + DRAGBUILD = categoryValue, + DUMMYGSRWEAPON = categoryValue, + DUMMYUNIT = categoryValue, + ECONOMIC = categoryValue, + ENERGYPRODUCTION = categoryValue, + ENERGYSTORAGE = categoryValue, + ENGINEER = categoryValue, + ENGINEERPRESET = categoryValue, + ENGINEERSTATION = categoryValue, + EXPERIMENTAL = categoryValue, + FACTORY = categoryValue, + FAVORSWATER = categoryValue, + FERRYBEACON = categoryValue, + FIELDENGINEER = categoryValue, + FRIGATE = categoryValue, + GATE = categoryValue, + GROUNDATTACK = categoryValue, + HELPER = categoryValue, + HIGHALTAIR = categoryValue, + HIGHPRIAIR = categoryValue, + HOVER = categoryValue, + HYDROCARBON = categoryValue, + INDIRECTFIRE = categoryValue, + INSIGNIFICANTUNIT = categoryValue, + INTEL = categoryValue, + INTELJAMMERPRESET = categoryValue, + INTELLIGENCE = categoryValue, + INVULNERABLE = categoryValue, + ISPREENHANCEDUNIT = categoryValue, + LAND = categoryValue, + LIGHTBOAT = categoryValue, + LOWSELECTPRIO = categoryValue, + MASSEXTRACTION = categoryValue, + MASSFABRICATION = categoryValue, + MASSPRODUCTION = categoryValue, + MASSSTORAGE = categoryValue, + MISSILE = categoryValue, + MISSILEPRESET = categoryValue, + MOBILE = categoryValue, + MOBILESONAR = categoryValue, + NANOCOMBATPRESET = categoryValue, + NAVALCARRIER = categoryValue, + NAVAL = categoryValue, + NEEDMOBILEBUILD = categoryValue, + NOFORMATION = categoryValue, + NOSPLASHDAMAGE = categoryValue, + NUKE = categoryValue, + NUKESUB = categoryValue, + OMNI = categoryValue, + OPERATION = categoryValue, + OPTICS = categoryValue, + ORBITALSYSTEM = categoryValue, + OVERLAYANTIAIR = categoryValue, + OVERLAYANTINAVY = categoryValue, + OVERLAYCOUNTERINTEL = categoryValue, + OVERLAYDEFENSE = categoryValue, + OVERLAYDIRECTFIRE = categoryValue, + OVERLAYINDIRECTFIRE = categoryValue, + OVERLAYMISC = categoryValue, + OVERLAYOMNI = categoryValue, + OVERLAYRADAR = categoryValue, + OVERLAYSONAR = categoryValue, + PATROLHELPER = categoryValue, + PERSONALSHIELD = categoryValue, + POD = categoryValue, + PODSTAGINGPLATFORM = categoryValue, + PRODUCTDL = categoryValue, + PRODUCTFA = categoryValue, + PRODUCTSC1 = categoryValue, + PROJECTILE = categoryValue, + RADAR = categoryValue, + RALLYPOINT = categoryValue, + RAMBOPRESET = categoryValue, + RASPRESET = categoryValue, + RECLAIMABLE = categoryValue, + RECLAIM = categoryValue, + RECLAIMFRIENDLY = categoryValue, + REPAIR = categoryValue, + RESEARCH = categoryValue, + SATELLITE = categoryValue, + SCOUT = categoryValue, + SELECTABLE = categoryValue, + SERAPHIM = categoryValue, + SHIELD = categoryValue, + SHIELDCOLLIDE = categoryValue, + SHIELDCOMBATPRESET = categoryValue, + SHOWATTACKRETICLE = categoryValue, + SHOWQUEUE = categoryValue, + SILO = categoryValue, + SIMPLECOMBATPRESET = categoryValue, + SIZE4 = categoryValue, + SIZE8 = categoryValue, + SIZE12 = categoryValue, + SIZE16 = categoryValue, + SIZE20 = categoryValue, + SNIPEMODE = categoryValue, + SNIPER = categoryValue, + SONAR = categoryValue, + SORTCONSTRUCTION = categoryValue, + SORTDEFENSE = categoryValue, + SORTECONOMY = categoryValue, + SORTINTEL = categoryValue, + SORTOTHER = categoryValue, + SORTSTRATEGIC = categoryValue, + SPECIALHIGHPRI = categoryValue, + SPECIALLOWPRI = categoryValue, + STATIONASSISTPOD = categoryValue, + STEALTH = categoryValue, + STEALTHFIELD = categoryValue, + STEALTHPRESET = categoryValue, + STRATEGICBOMBER = categoryValue, + STRATEGIC = categoryValue, + STRUCTURE = categoryValue, + SUBCOMMANDER = categoryValue, + SUBMERSIBLE = categoryValue, + SUPPORTFACTORY = categoryValue, + T1SUBMARINE = categoryValue, + T2SUBMARINE = categoryValue, + TACTICAL = categoryValue, + TACTICALMISSILEPLATFORM = categoryValue, + TANK = categoryValue, + TARGETCHASER = categoryValue, + TECH1 = categoryValue, + TECH2 = categoryValue, + TECH3 = categoryValue, + TECH_THREE = categoryValue, + TECH_TWO = categoryValue, + TELEPORTBEACON = categoryValue, + TORPEDO = categoryValue, + TRANSPORTATION = categoryValue, + TRANSPORTBUILTBYTIER1FACTORY = categoryValue, + TRANSPORTBUILTBYTIER2FACTORY = categoryValue, + TRANSPORTBUILTBYTIER3FACTORY = categoryValue, + TRANSPORTFOCUS = categoryValue, + UEF = categoryValue, + UNSELECTABLE = categoryValue, + UNSPAWNABLE = categoryValue, + UNTARGETABLE = categoryValue, + USEBUILDPRESETS = categoryValue, + VERIFYMISSILEUI = categoryValue, + VISIBLETORECON = categoryValue, + VOLATILE = categoryValue, + WALL = categoryValue, +} diff --git a/engine/Core.lua b/engine/Core.lua index f006c0cc73..98a0cfe597 100644 --- a/engine/Core.lua +++ b/engine/Core.lua @@ -1,3 +1,4 @@ +---@declare-global ---Module: Core -- @module Core @@ -6,9 +7,11 @@ function AITarget() end ---- --- base = Basename(fullPath,stripExtension?) -- return the last component of a path -function Basename(fullPath, stripExtension?) + +--- return the last component of a path +---@param fullPath string +---@param stripExtension boolean? +function Basename(fullPath, stripExtension) end --- @@ -51,9 +54,10 @@ end function DiskToLocal(SysOrLocalPath) end ---- --- EndLoggingStats(bool exit) - End logging stats and optionally exit app -function EndLoggingStats(bool exit) + +---End logging stats and optionally exit app +---@param exit boolean +function EndLoggingStats(exit) end --- @@ -72,8 +76,11 @@ function EnumColorNames() end --- --- quaternion EulerToQuaternion(float roll, float pitch, float yaw) - converts euler angles to a quaternion -function EulerToQuaternion(float roll, float pitch, float yaw) +---converts euler angles to a quaternion +---@param roll number float +---@param pitch number float +---@param yaw number float +function EulerToQuaternion(roll, pitch, yaw) end --- @@ -83,7 +90,10 @@ end --- -- thread = ForkThread(function, ...)Spawns a new thread running the given function with the given args. -function ForkThread(function, ...) +---@param callback function +---@vararg any arguments to pass into function +---@return thread +function ForkThread(callback, ...) end --- @@ -115,7 +125,7 @@ end -- @param TextOne Log message -- @param TextTwo Optional text -- Output: "INFO: TextOne\000TextTwo" -function LOG('TextOne','TextTwo') +function LOG(TextOne, TextTwo) end --- @@ -130,12 +140,18 @@ end --- -- quaternion MinLerp(float alpha, quaternion L, quaternion R) - returns minimal lerp between L and R -function MinLerp(float alpha, quaternion L, quaternion R) +---@param alpha number +---@param L unknown quaternion +---@param R unknown quaternion +function MinLerp(alpha, L, R) end --- -- quaternion MinSlerp(float alpha, quaternion L, quaternion R) - returns minimal slerp between L and R -function MinSlerp(float alpha, quaternion L, quaternion R) +---@param alpha number +---@param L unknown quaternion +---@param R unknown quaternion +function MinSlerp(alpha, L, R) end --- @@ -150,7 +166,8 @@ end --- -- RPCSound({cue,bank,cutoff}) - Make a sound parameters object -function RPCSound({cue, bank, cutoff}) +---@param sound {cue:unknown, bank:unknown, cutoff:unknown} +function RPCSound(sound) end --- @@ -199,10 +216,10 @@ function ResumeThread(thread) end --- Print a debug message --- @param TextOne Debug message --- @param TextTwo Optional text +---@param TextOne string Debug message +---@param TextTwo string? Optional text -- Output: "DEBUG: TextOne\000TextTwo" -function SPEW('TextOne','TextTwo') +function SPEW(TextOne,TextTwo) end --- @@ -237,7 +254,8 @@ end --- -- Sound({cue,bank,cutoff}) - Make a sound parameters object -function Sound({cue, bank, cutoff}) +---@param sound {cue:unknown, bank:unknown, cutoff:unknown} +function Sound(sound) end --- @@ -251,8 +269,9 @@ function SuspendCurrentThread() end --- --- Trace(true) -- turns on debug tracingTrace(false) -- turns it off again -function Trace(true) +-- Trace(true) -- turns on debug. tracingTrace(false) -- turns it off again +---@param enable boolean +function Trace(enable) end --- @@ -267,12 +286,20 @@ end --- -- Distance between two 2d points (x1,y1,x2,y2) -function VDist2() +---@param x1 number +---@param y1 number +---@param x2 number +---@param y2 number +function VDist2(x1, y1, x2, y2) end --- -- Square of Distance between two 2d points (x1,y1,x2,y2) -function VDist2Sq() +---@param x1 number +---@param y1 number +---@param x2 number +---@param y2 number +function VDist2Sq(x1, y1, x2, y2) end --- @@ -311,10 +338,10 @@ function Vector2() end --- Print a warning message --- @param TextOne Warning message --- @param TextTwo Optional text +---@param TextOne string Warning message +---@param TextTwo string? Optional text -- Output: "WARNING: TextOne\000TextTwo" -function WARN('TextOne','TextTwo') +function WARN(TextOne, TextTwo) end --- @@ -324,11 +351,17 @@ end --- -- doscript(script, [env]) -- run another script. The environment table, if given, will be used for the script's global variables. -function doscript(script, [env]) +---comment +---@param script string +---@param env table? +---@diagnostic disable-next-line: lowercase-global +function doscript(script, env) end --- -- exists(name) -> bool -- returns true if the given resource file exists +---@param name string +---@diagnostic disable-next-line: lowercase-global function exists(name) end diff --git a/engine/Patches.lua b/engine/Patches.lua index 6f69363289..7bdbe7b929 100644 --- a/engine/Patches.lua +++ b/engine/Patches.lua @@ -3,11 +3,13 @@ -- sim version of GetStat(). Awesome function as it already sends a string, integer and unit object to engine + -- returns a table with values. This is basically all you need for lua<->engine communication. - +-- -- "h1_SetSalemAmph" 1/0 controls amhibious mode for Salem destroyer. It takes unit's C-object and changes bp pointer -- to a copy of urs0201 bp with bp.Footprint.MinWaterDepth = 1.5 and bp.Footprint.OccupancyCaps = 8. These 2 parameters are used in -- movement calculation. Physics.MotionType doesn't really matter in this case and engine uses it only to -- setup these parameters from bp.Footprint -function GetStat(Name[,defaultVal]) +---@param Name string +---@param defaultVal any? +function GetStat(Name,defaultVal) unit:GetStat("h1_SetSalemAmph", 1) -- 1 = on, 0 = off. end \ No newline at end of file diff --git a/engine/Sim.lua b/engine/Sim.lua index 6a696610f5..7b0fe2349a 100644 --- a/engine/Sim.lua +++ b/engine/Sim.lua @@ -1,3 +1,4 @@ +---@declare-global ---Module: Sim -- @module Sim @@ -60,7 +61,12 @@ function CoordinateAttacks() end --- TODO. -function CreateAimController(weapon, label, turretBone, [barrelBone], [muzzleBone]) +---@param weapon any +---@param label any +---@param turretBone any +---@param barrelBone any? +---@param muzzleBone any? +function CreateAimController(weapon, label, turretBone, barrelBone, muzzleBone) end --- Create a manipulator for playing animations. @@ -92,7 +98,11 @@ function CreateBeamToEntityBone(entity, bone, other, bone, army, thickness, text end --- TODO. -function CreateBuilderArmController(unit,turretBone, [barrelBone], [aimBone]) +---@param unit any +---@param turretBone any +---@param barrelBone any? +---@param aimBone any? +function CreateBuilderArmController(unit,turretBone, barrelBone, aimBone) end --- Create a collision detection manipulator @@ -140,7 +150,13 @@ function CreateEmitterOnEntity(entity, army, emitter_bp_name) end --- TODO. -function CreateFootPlantController(unit, footBone, kneeBone, hipBone, [straightLegs], [maxFootFall]) +---@param unit any +---@param footBone any +---@param kneeBone any +---@param hipBone any +---@param straightLegs any? +---@param maxFootFall any? +function CreateFootPlantController(unit, footBone, kneeBone, hipBone, straightLegs, maxFootFall) end --- Spawns initial unit for the given army. @@ -190,15 +206,15 @@ function CreateResourceDeposit(type, x, y, z, size) end --- Create a manipulator which rotates unit's bone. --- @param unit Unit to create the manipulator for. --- @param bone String, name of the bone to rotate. --- @param axis String, 'x', 'Y' or 'z', axis to rotate around. --- @param [goal] TODO. --- @param [speed] TODO. --- @param [accel] TODO. --- @param [goalspeed] TODO. +---@param unit Unit to create the manipulator for. +---@param bone string name of the bone to rotate. +---@param axis string 'x', 'Y' or 'z', axis to rotate around. +---@param goal unknown? TODO. +---@param speed unknown? TODO. +---@param accel unknown? TODO. +---@param goalspeed unknown? TODO. -- @return manipulator -function CreateRotator(unit, bone, axis, [goal], [speed], [accel], [goalspeed]) +function CreateRotator(unit, bone, axis, goal, speed, accel, goalspeed) end --- Create a manipulator which copies the motion of src_bone onto dst_bone. @@ -237,7 +253,17 @@ function CreateTrail(entity, bone, army, trail_blueprint) end --- TODO. -function CreateUnit(blueprint, army, tx, ty, tz, qx, qy, qz, qw, [layer]) +---@param blueprint any +---@param army any +---@param tx any +---@param ty any +---@param tz any +---@param qx any +---@param qy any +---@param qz any +---@param qw any +---@param layer any? +function CreateUnit(blueprint, army, tx, ty, tz, qx, qy, qz, qw, layer) end --- TODO. @@ -257,26 +283,26 @@ function Damage(instigator, target, amount, damageType) end --- Deals damage to the target unit. --- @param instigator Source of the damage (unit) or nil. --- @param location Table with position {x, y, z}. --- @param radius Number, distance from the location to deal the damage. --- @param amount Number, amount of damage. --- @param damageType Example: 'Force', 'Normal', 'Nuke', 'Fire', TODO. --- @param damageFriendly true/false if it should damage allied units. --- @param [damageSelf] true/false if the unit dealing the damage should take it as well. -function DamageArea(instigator, location, radius, amount, damageType, damageFriendly, [damageSelf]) +---@param instigator Unit Source of the damage (unit) or nil. +---@param location {x:number, y:number, z:number} with position {x, y, z}. +---@param radius number distance from the location to deal the damage. +---@param amount number amount of damage. +---@param damageType string 'Force', 'Normal', 'Nuke', 'Fire', TODO. +---@param damageFriendly boolean if it should damage allied units. +---@param damageSelf boolean? if the unit dealing the damage should take it as well. +function DamageArea(instigator, location, radius, amount, damageType, damageFriendly, damageSelf) end --- Deals damage to the target unit. --- @param instigator Source of the damage (unit) or nil. --- @param location Table with position {x, y, z}. --- @param minRadius Number, distance from the location to start dealing damage. --- @param maxRadius Number, distance from the location to stop dealing damage. --- @param amount Number, amount of damage. --- @param damageType Example: 'Force', 'Normal', 'Nuke', 'Fire', TODO. --- @param damageFriendly true/false if it should damage allied units. --- @param [damageSelf] true/false if the unit dealing the damage should take it as well. -function DamageRing(instigator, location, minRadius, maxRadius, amount, damageType, damageFriendly, [damageSelf]) +---@param instigator Unit Source of the damage (unit) or nil. +---@param location {x:number, y:number, z:number} with position {x, y, z}. +---@param minRadius number distance from the location to start dealing damage. +---@param maxRadius number distance from the location to stop dealing damage. +---@param amount number amount of damage. +---@param damageType string 'Force', 'Normal', 'Nuke', 'Fire', TODO. +---@param damageFriendly boolean if it should damage allied units. +---@param damageSelf boolean if the unit dealing the damage should take it as well. +function DamageRing(instigator, location, minRadius, maxRadius, amount, damageType, damageFriendly, damageSelf) end --- Get DEBUG info for UI selection. @@ -365,6 +391,8 @@ function GenerateRandomOrientation() end --- Returns an army brain given the brain's name. +---@param strArmy any +---@return AIBrain function GetArmyBrain(strArmy) end @@ -423,9 +451,9 @@ end --- Returns surface elevation at given position. -- Takes water into count. --- @param x Position on x axis. --- @param z Position on x axis. -function GetSurfaceHeight(x z) +---@param x number Position on x axis. +---@param z number Position on z axis. +function GetSurfaceHeight(x, z) end --- Returns System time in seconds. @@ -438,19 +466,19 @@ end -- Ignores water surface. -- @param x Position on x axis. -- @param z Position on x axis. -function GetTerrainHeight(x z) +function GetTerrainHeight(x, z) end --- Returns terrain type at given position. -- INFO: type = GetTerrainType(x,z). -- @param x Position on x axis. -- @param z Position on z axis. -function GetTerrainType(x z) +function GetTerrainType(x, z) end --- TODO. -- INFO: type = GetTerrainTypeOffset(x,z). -function GetTerrainTypeOffset(x z) +function GetTerrainTypeOffset(x, z) end --- Returns unit's blueprint given the blueprint's name. @@ -821,7 +849,13 @@ function ListArmies() end --- TODO. -function MetaImpact(instigator, location, fMaxRadius, iAmount, affectsCategory, [damageFriendly]) +---@param instigator any +---@param location any +---@param fMaxRadius any +---@param iAmount any +---@param affectsCategory any +---@param damageFriendly any? +function MetaImpact(instigator, location, fMaxRadius, iAmount, affectsCategory, damageFriendly) end --- TODO. @@ -1027,10 +1061,12 @@ function Warp(entity, location, orientation) end --- TODO. +---@diagnostic disable-next-line: lowercase-global function _c_CreateEntity(spec) end --- TODO. +---@diagnostic disable-next-line: lowercase-global function _c_CreateShield(spec) end @@ -1044,10 +1080,6 @@ end function base() end ---- --- -function moho.CollisionBeamEntity() -end --- Sinks the entity into the ground. -- Used for dead trees for example. @@ -1055,10 +1087,6 @@ end function SinkAway(vy) end ---- --- -function moho.entity_methods() -end ------ -- New functions from engine patch: @@ -1077,13 +1105,15 @@ end -- Allows set the rights to the army -- targetArmyIndex, sourceHumanIndex is 0 based index --- 'Set or Unset' is boolean -- Nothing returns -function SetCommandSource(targetArmyIndex, sourceHumanIndex, Set or Unset) +---@param targetArmyIndex any +---@param sourceHumanIndex any +---@param enable boolean +function SetCommandSource(targetArmyIndex, sourceHumanIndex, enable) end -- Sets the focus without checking rights --- armyIndex is 0 based index +---@param armyIndex number is 0 based index or -1 -- Nothing returns -function SetFocusArmy(armyIndex or -1) +function SetFocusArmy(armyIndex) end diff --git a/engine/Sim/CAiAttackerImpl.lua b/engine/Sim/CAiAttackerImpl.lua index 0f60b0d9bf..a8c9829445 100644 --- a/engine/Sim/CAiAttackerImpl.lua +++ b/engine/Sim/CAiAttackerImpl.lua @@ -1,5 +1,6 @@ ---- Class CAiAttackerImpl --- @classmod Sim.CAiAttackerImpl +---@declare-global +---@class CAiAttackerImpl +local CAiAttackerImpl = {} --- -- Loop through the weapons to see if the target can be attacked @@ -80,9 +81,3 @@ end -- Stop the attacker function CAiAttackerImpl:Stop() end - ---- --- -function CAiAttackerImpl:moho.CAiAttackerImpl_methods() -end - diff --git a/engine/Sim/CAiBrain.lua b/engine/Sim/CAiBrain.lua index 5ec160c057..7b98d632eb 100644 --- a/engine/Sim/CAiBrain.lua +++ b/engine/Sim/CAiBrain.lua @@ -1,5 +1,6 @@ ---- Class CAiBrain --- @classmod Sim.CAiBrain +---@declare-global +---@class moho.aibrain_methods +local CAiBrain = {} --- Assigns threat value to given position. -- Threat is used for calculation where to attack with unit. @@ -229,8 +230,8 @@ function CAiBrain:GetEconomyStoredRatio(resource) end --- Returns the relative resource income. (production - usage) --- @param resource 'ENERGY' or 'MASS'. --- @return Number. (0.1 = 1) +---@param resource 'ENERGY'|'MASS'. +---@return number (0.1 = 1) function CAiBrain:GetEconomyTrend(resource) end @@ -243,7 +244,7 @@ end --- Returns the faction of the army represented by this brain. -- 1 UEF, 2 Aeon, 3 Cybran, 4 Seraphim. 5 custom faction like Nomads --- @return Number. +---@return number function CAiBrain:GetFactionIndex() end @@ -456,8 +457,4 @@ end function CAiBrain:TakeResource(type, amount) end ---- --- -function CAiBrain:moho.aibrain_methods() -end - +return CAiBrain \ No newline at end of file diff --git a/engine/Sim/CAimManipulator.lua b/engine/Sim/CAimManipulator.lua index 54b29af921..4b54591d4a 100644 --- a/engine/Sim/CAimManipulator.lua +++ b/engine/Sim/CAimManipulator.lua @@ -1,5 +1,6 @@ ---- Class CAimManipulator --- @classmod Sim.CAimManipulator +---@declare-global +---@class moho.AimManipulator +local CAimManipulator = {} --- -- AimManipulator:OnTarget() @@ -36,8 +37,5 @@ end function CAimManipulator:base() end ---- --- -function CAimManipulator:moho.AimManipulator() -end +return CAimManipulator diff --git a/engine/Sim/CAnimationManipulator.lua b/engine/Sim/CAnimationManipulator.lua index b5c960012f..a4c7a9fe79 100644 --- a/engine/Sim/CAnimationManipulator.lua +++ b/engine/Sim/CAnimationManipulator.lua @@ -1,5 +1,6 @@ ---- Class CAnimationManipulator --- @classmod Sim.CAnimationManipulator +---@declare-global +---@class moho.AnimationManipulator +local CAnimationManipulator = {} --- -- fraction = AnimationManipulator:GetAnimationFraction() @@ -61,8 +62,5 @@ end function CAnimationManipulator:base() end ---- --- -function CAnimationManipulator:moho.AnimationManipulator() -end +return CAnimationManipulator diff --git a/engine/Sim/CBoneEntityManipulator.lua b/engine/Sim/CBoneEntityManipulator.lua index b1c0842d64..2b50ad6244 100644 --- a/engine/Sim/CBoneEntityManipulator.lua +++ b/engine/Sim/CBoneEntityManipulator.lua @@ -6,8 +6,5 @@ function CBoneEntityManipulator:base() end ---- --- -function CBoneEntityManipulator:moho.BoneEntityManipulator() -end + diff --git a/engine/Sim/CBuilderArmManipulator.lua b/engine/Sim/CBuilderArmManipulator.lua index e52891ba39..a3f0a48b40 100644 --- a/engine/Sim/CBuilderArmManipulator.lua +++ b/engine/Sim/CBuilderArmManipulator.lua @@ -1,5 +1,6 @@ ---- Class CBuilderArmManipulator --- @classmod Sim.CBuilderArmManipulator +---@declare-global +---@class moho.BuilderArmManipulator +local CBuilderArmManipulator = {} --- -- BuilderArmManipulator:SetAimingArc(minHeading, maxHeading, headingMaxSlew, minPitch, maxPitch, pitchMaxSlew) @@ -16,8 +17,4 @@ end function CBuilderArmManipulator:base() end ---- --- -function CBuilderArmManipulator:moho.BuilderArmManipulator() -end - +return CBuilderArmManipulator diff --git a/engine/Sim/CCollisionManipulator.lua b/engine/Sim/CCollisionManipulator.lua index 1a373808de..ff48c0de51 100644 --- a/engine/Sim/CCollisionManipulator.lua +++ b/engine/Sim/CCollisionManipulator.lua @@ -1,5 +1,6 @@ ---- Class CCollisionManipulator --- @classmod Sim.CCollisionManipulator +---@declare-global +---@class moho.CollisionManipulator +local CCollisionManipulator = {} --- -- Fixme: this should just use base manipulator enable/disable @@ -21,8 +22,5 @@ end function CCollisionManipulator:base() end ---- --- -function CCollisionManipulator:moho.CollisionManipulator() -end +return CCollisionManipulator diff --git a/engine/Sim/CPlatoon.lua b/engine/Sim/CPlatoon.lua index a39b59fcf3..dfb09632eb 100644 --- a/engine/Sim/CPlatoon.lua +++ b/engine/Sim/CPlatoon.lua @@ -1,5 +1,6 @@ ---- Class CPlatoon --- @classmod Sim.CPlatoon +---@declare-global +---@class moho.platoon_methods +local CPlatoon = {} --- Orders platoon to attack target unit. -- If squad is specified, attacks only with the squad. @@ -305,8 +306,4 @@ end function CPlatoon:UseTeleporter(gameObject, [squad]) end ---- --- -function CPlatoon:moho.platoon_methods() -end - +return CPlatoon diff --git a/engine/Sim/CRotateManipulator.lua b/engine/Sim/CRotateManipulator.lua index 91cb59b3b8..6dfb49a2b7 100644 --- a/engine/Sim/CRotateManipulator.lua +++ b/engine/Sim/CRotateManipulator.lua @@ -1,5 +1,6 @@ ---- Class CRotateManipulator --- @classmod Sim.CRotateManipulator +---@declare-global +---@class moho.RotateManipulator +local CRotateManipulator = {} --- -- RotateManipulator:ClearGoal() @@ -51,8 +52,5 @@ end function CRotateManipulator:base() end ---- --- -function CRotateManipulator:moho.RotateManipulator() -end +return CRotateManipulator diff --git a/engine/Sim/CSlideManipulator.lua b/engine/Sim/CSlideManipulator.lua index d800beb56a..68e89e22ed 100644 --- a/engine/Sim/CSlideManipulator.lua +++ b/engine/Sim/CSlideManipulator.lua @@ -1,5 +1,6 @@ ---- Class CSlideManipulator --- @classmod Sim.CSlideManipulator +---@declare-global +---@class moho.SlideManipulator +local CSlideManipulator = {} --- -- CSlideManipulator:SetAcceleration(acc) @@ -31,8 +32,4 @@ end function CSlideManipulator:base() end ---- --- -function CSlideManipulator:moho.SlideManipulator() -end - +return CSlideManipulator diff --git a/engine/Sim/CollisionBeamEntity.lua b/engine/Sim/CollisionBeamEntity.lua index 08fd75912d..edf0a61bd2 100644 --- a/engine/Sim/CollisionBeamEntity.lua +++ b/engine/Sim/CollisionBeamEntity.lua @@ -1,5 +1,6 @@ ---- Class CollisionBeamEntity --- @classmod Sim.CollisionBeamEntity +---@declare-global +---@class moho.CollisionBeamEntity +local CollisionBeamEntity = {} --- -- CollisionBeamEntity:Enable() @@ -26,3 +27,4 @@ end function CollisionBeamEntity:__init() end +return CollisionBeamEntity diff --git a/engine/Sim/Entity.lua b/engine/Sim/Entity.lua index ddb72c96a8..6b405df272 100644 --- a/engine/Sim/Entity.lua +++ b/engine/Sim/Entity.lua @@ -1,5 +1,9 @@ ---- Class Entity --- @classmod Sim.Entity +---@declare-global +---@class moho.entity_methods +local Entity = {} + +---@alias Army number +---@alias EntityId number --- -- Entity:AddManualScroller(scrollSpeed1, scrollSpeed2) @@ -103,6 +107,7 @@ end --- -- GetArmy(self) +---@return Army function Entity:GetArmy(self) end @@ -133,6 +138,7 @@ end --- -- Entity:GetEntityId() +---@return EntityId function Entity:GetEntityId() end @@ -316,3 +322,4 @@ end function Entity:ShakeCamera(radius, max, min, duration) end +return Entity \ No newline at end of file diff --git a/engine/Sim/IAniManipulator.lua b/engine/Sim/IAniManipulator.lua index 007eaeeae8..1c1f4a95f9 100644 --- a/engine/Sim/IAniManipulator.lua +++ b/engine/Sim/IAniManipulator.lua @@ -1,6 +1,6 @@ ---- Class IAniManipulator --- @classmod Sim.IAniManipulator - +---@declare-global +---@class moho.manipulator_methods +local IAniManipulator = {} --- -- Manipulator:Disable() -- disable a manipulator. This immediately removes it from the bone computation, which may result in the bone's position snapping. function IAniManipulator:Disable() @@ -16,8 +16,4 @@ end function IAniManipulator:SetPrecedence(integer) end ---- --- -function IAniManipulator:moho.manipulator_methods() -end - +return IAniManipulator diff --git a/engine/Sim/IEffect.lua b/engine/Sim/IEffect.lua index 0ea1d716f1..e27308d700 100644 --- a/engine/Sim/IEffect.lua +++ b/engine/Sim/IEffect.lua @@ -1,6 +1,6 @@ ---- Class IEffect --- @classmod Sim.IEffect - +---@declare-global +---@class moho.IEffect +local IEffect = {} --- -- Effect:OffsetEmitter(x,y,z) function IEffect:OffsetEmitter(x, y, z) @@ -16,9 +16,10 @@ end function IEffect:ScaleEmitter(param, scale) end ---- --- effect:SetBeamParam('name', value) -function IEffect:SetBeamParam('name', value) +---todo +---@param name string +---@param value number +function IEffect:SetBeamParam(name, value) end --- @@ -26,13 +27,11 @@ end function IEffect:SetEmitterCurveParam(param_name, height, size) end ---- --- effect:SetEmitterParam('name', value)returns the effect so you can chain calls like:effect:SetEmitterParam('x',1):ScaleEmitter(3.7) -function IEffect:SetEmitterParam('name', value) -end - ---- --- -function IEffect:moho.IEffect() +--- returns the effect so you can chain calls like `effect:SetEmitterParam('x',1):ScaleEmitter(3.7)` +---@param name string +---@param value number +---@return moho.IEffect +function IEffect:SetEmitterParam(name, value) end +return IEffect diff --git a/engine/Sim/Projectile.lua b/engine/Sim/Projectile.lua index ac79e2a072..291c09c55f 100644 --- a/engine/Sim/Projectile.lua +++ b/engine/Sim/Projectile.lua @@ -1,5 +1,6 @@ ---- Class Projectile --- @classmod Sim.Projectile +---@declare-global +---@class moho.projectile_methods : moho.entity_methods +local Projectile = {} --- -- Change the detonate below height for the projectile @@ -152,8 +153,4 @@ end function Projectile:base() end ---- --- -function Projectile:moho.projectile_methods() -end - +return Projectile \ No newline at end of file diff --git a/engine/Sim/Prop.lua b/engine/Sim/Prop.lua index 8484c837fb..fb418065c8 100644 --- a/engine/Sim/Prop.lua +++ b/engine/Sim/Prop.lua @@ -1,13 +1,9 @@ ---- Class Prop --- @classmod Sim.Prop - +---@declare-global +---@class moho.prop_methods +local Prop = {} --- -- derived from Entity function Prop:base() end ---- --- -function Prop:moho.prop_methods() -end - +return Prop diff --git a/engine/Sim/Shield.lua b/engine/Sim/Shield.lua index fe839f5b6b..11812233e8 100644 --- a/engine/Sim/Shield.lua +++ b/engine/Sim/Shield.lua @@ -1,8 +1,4 @@ ---- Class Shield --- @classmod Sim.Shield - ---- --- -function Shield:moho.shield_methods() -end - +---@declare-global +---@class moho.shield_methods +local Shield = {} +return Shield diff --git a/engine/Sim/Unit.lua b/engine/Sim/Unit.lua index cabd148b3d..27f766ef75 100644 --- a/engine/Sim/Unit.lua +++ b/engine/Sim/Unit.lua @@ -1,40 +1,42 @@ ---- Class Unit --- @classmod Sim.Unit +---@declare-global +---@class moho.unit_methods : moho.entity_methods +local Unit = {} + +---@alias UnitId number --- Add a command cap to a unit. --- Also adds a button to the UI, or enables it, for the unit to use the new command. --- @param capName String Available: --- RULEUCC_Move --- RULEUCC_Stop --- RULEUCC_Attack --- RULEUCC_Guard --- RULEUCC_Patrol --- RULEUCC_RetaliateToggle --- RULEUCC_Repair --- RULEUCC_Capture --- RULEUCC_Transport --- RULEUCC_CallTransport --- RULEUCC_Nuke --- RULEUCC_Tactical --- RULEUCC_Teleport --- RULEUCC_Ferry --- RULEUCC_SiloBuildTactical --- RULEUCC_SiloBuildNuke --- RULEUCC_Sacrifice --- RULEUCC_Pause --- RULEUCC_Overcharge --- RULEUCC_Dive --- RULEUCC_Reclaim --- RULEUCC_SpecialAction --- RULEUCC_Dock --- RULEUCC_Script --- RULEUCC_Invalid +--- Also adds a button to the UI, or enables it, for the unit to use the new command. +---@param capName "RULEUCC_Move" +--- |"RULEUCC_Stop" +--- |"RULEUCC_Attack" +--- |"RULEUCC_Guard" +--- |"RULEUCC_Patrol" +--- |"RULEUCC_RetaliateToggle" +--- |"RULEUCC_Repair" +--- |"RULEUCC_Capture" +--- |"RULEUCC_Transport" +--- |"RULEUCC_CallTransport" +--- |"RULEUCC_Nuke" +--- |"RULEUCC_Tactical" +--- |"RULEUCC_Teleport" +--- |"RULEUCC_Ferry" +--- |"RULEUCC_SiloBuildTactical" +--- |"RULEUCC_SiloBuildNuke" +--- |"RULEUCC_Sacrifice" +--- |"RULEUCC_Pause" +--- |"RULEUCC_Overcharge" +--- |"RULEUCC_Dive" +--- |"RULEUCC_Reclaim" +--- |"RULEUCC_SpecialAction" +--- |"RULEUCC_Dock" +--- |"RULEUCC_Script" +--- |"RULEUCC_Invalid" function Unit:AddCommandCap(capName) end --- Add a toggle cap to a unit. --- Also adds a button to the UI, or enables it, for the unit to use the new command. --- @param capName String Available: +--- Also adds a button to the UI, or enables it, for the unit to use the new command. +---@param capName string Available: -- RULEUTC_ShieldToggle -- RULEUTC_WeaponToggle -- RULEUTC_JammingToggle @@ -88,7 +90,9 @@ function Unit:ClearFocusEntity() end --- TODO. -function Unit:EnableManipulators([string boneName | int boneIndex], bool Enable) +---@param bone string|number boneName or boneIndex +---@param Enable boolean +function Unit:EnableManipulators(bone, Enable) end --- TODO. @@ -223,12 +227,13 @@ end --- Find out unit's specific statistics. -- Example: 'KILLS'. --- @param statName String, name of the stat to find out. --- @param [defaultVal] TODO. +---@param statName string, name of the stat to find out. +---@param defaultVal? number TODO. +---@return number -- Special case for the Salem: -- GetStat("h1_SetSalemAmph", 0 or 1) -- Disable/Enable amphibious mode -function Unit:GetStat(statName, [defaultVal]) +function Unit:GetStat(statName, defaultVal) end --- Find out number of tactical missile this unit has available. @@ -247,7 +252,7 @@ function Unit:GetTransportFerryBeacon() end --- Returns the unit's blueprint ID. --- @return bpID +---@return UnitId bpID function Unit:GetUnitId(self) end @@ -353,7 +358,8 @@ function Unit:KillManipulator() end --- TODO. -function Unit:KillManipulators([boneName|boneIndex]) +---@param bone string|number boneName|boneIndex +function Unit:KillManipulators(bone) end --- TODO. @@ -717,8 +723,4 @@ end function Unit:base() end ---- --- -function Unit:moho.unit_methods() -end - +return Unit \ No newline at end of file diff --git a/engine/Sim/UnitWeapon.lua b/engine/Sim/UnitWeapon.lua index 6696a9ef57..ee2b9417d2 100644 --- a/engine/Sim/UnitWeapon.lua +++ b/engine/Sim/UnitWeapon.lua @@ -1,5 +1,6 @@ ---- Class UnitWeapon --- @classmod Sim.UnitWeapon +---@declare-global +---@class moho.weapon_methods +local UnitWeapon = {} --- -- UnitWeapon:CanFire() @@ -156,8 +157,4 @@ end function UnitWeapon:WeaponHasTarget() end ---- --- -function UnitWeapon:moho.weapon_methods() -end - +return UnitWeapon diff --git a/engine/User.lua b/engine/User.lua index 2a195996bd..be7e2a67e2 100644 --- a/engine/User.lua +++ b/engine/User.lua @@ -1,3 +1,4 @@ +---@declare-global ---Module: User -- @module User @@ -13,7 +14,8 @@ end --- -- handler AddConsoleOutputReciever(func(text)) -function AddConsoleOutputReciever(func(text) +---@param func fun(text: string): any +function AddConsoleOutputReciever(func) end --- @@ -37,8 +39,8 @@ function AnyInputCapture() end --- --- AudioSetLanguage(name() -function AudioSetLanguage(name() +-- AudioSetLanguage(name) +function AudioSetLanguage(name) end --- @@ -53,7 +55,8 @@ end --- -- ClearFrame(int head) - destroy all controls in frame, nil head will clear all frames -function ClearFrame(int head) +---@param head number int +function ClearFrame(head) end --- @@ -63,12 +66,14 @@ end --- -- ConExecute('command string') -- Perform a console command -function ConExecute('command string') +---@param command string +function ConExecute(command) end --- -- ConExecuteSave('command string') -- Perform a console command, saved to stack -function ConExecuteSave('command string') +---@param command string +function ConExecuteSave(command) end --- @@ -78,12 +83,19 @@ end --- -- CopyCurrentReplay(string profile, string newFilename) - copy the current replay to another file -function CopyCurrentReplay(string profile, string newFilename) +---@param profile string +---@param newFilename string +function CopyCurrentReplay(profile, newFilename) end --- -- CreateUnitAtMouse -function CreateUnitAtMouse(string blueprintId, int ownerArmyIndex, float offsetMouseWorldPosX, float offsetMouseWorldPosZ, float rotation) +---@param blueprintId string +---@param ownerArmyIndex number int +---@param offsetMouseWorldPosX number float +---@param offsetMouseWorldPosZ number float +---@param rotation number float +function CreateUnitAtMouse(blueprintId, ownerArmyIndex, offsetMouseWorldPosX, offsetMouseWorldPosZ, rotation) end --- @@ -113,7 +125,8 @@ end --- -- EjectSessionClient(int clientIndex) -- eject another client from your session -function EjectSessionClient(int clientIndex) +---@param clientIndex number int +function EjectSessionClient(clientIndex) end --- @@ -263,7 +276,8 @@ end --- -- frame GetFrame(int head) - return the root UI frame for a given head -function GetFrame(int head) +---@param head number int +function GetFrame(head) end --- @@ -348,7 +362,9 @@ end --- -- obj GetPreference(string, [default]) -function GetPreference(string, [default]) +---@param string string +---@param default any? +function GetPreference(string, default) end --- @@ -388,22 +404,30 @@ end --- -- table GetSpecialFileInfo(string profileName, string basename, string type) - get information on a profile based file, nil if unable to find -function GetSpecialFileInfo(string profileName, string basename, string type) +---@param profileName string +---@param basename string +---@param type string +function GetSpecialFileInfo(profileName, basename, type) end --- -- string GetSpecialFilePath(string profilename, string filename, string type) - Given the base name of a special file, retuns the complete path -function GetSpecialFilePath(string profilename, string filename, string type) +---@param profilename string +---@param filename string +---@param type string +function GetSpecialFilePath(profilename, filename, type) end --- -- table GetSpecialFiles(string type)- returns a table of strings which are the names of files in special locations (currently SaveFile, Replay) -function GetSpecialFiles(string type) +---@param type string +function GetSpecialFiles(type) end --- -- string GetSpecialFolder(string type) -function GetSpecialFolder(string type) +---@param type string +function GetSpecialFolder(type) end --- @@ -418,7 +442,9 @@ end --- -- width, height GetTextureDimensions(filename, border = 1) -function GetTextureDimensions(filename, border = 1) +---@param filename string +---@param border number? default value 1 +function GetTextureDimensions(filename, border) end --- @@ -458,7 +484,10 @@ end --- -- GpgNetSend(cmd,args...) -function GpgNetSend(cmd, args...) +---comment +---@param cmd string +---@vararg any +function GpgNetSend(cmd, ...) end --- @@ -538,7 +567,14 @@ end --- -- InternalCreateLobby(class, string protocol, int localPort, int maxConnections, string playerName, string playerUID, Boxed > natTraversalProvider) -function InternalCreateLobby(class, string protocol, int localPort, int maxConnections, string playerName, string playerUID, Boxed > natTraversalProvider) +---@param class any +---@param protocol string +---@param localPort number int +---@param maxConnections number int +---@param playerName string +---@param playerUID string +---@param natTraversalProvider any Boxed > +function InternalCreateLobby(class, protocol, localPort, maxConnections, playerName, playerUID, natTraversalProvider) end --- @@ -608,12 +644,20 @@ end --- -- IssueBlueprintCommand(command, blueprintid, count, clear = false) -function IssueBlueprintCommand(command, blueprintid, count, clear = false) +---comment +---@param command any +---@param blueprintid any +---@param count any +---@param clear boolean? defaults to false +function IssueBlueprintCommand(command, blueprintid, count, clear) end --- -- IssueCommand(command,[string],[clear]) -function IssueCommand(command, [string], [clear]) +---@param command any +---@param string any? +---@param clear boolean? +function IssueCommand(command, string, clear) end --- @@ -623,7 +667,12 @@ end --- -- IssueUnitCommand(unitList,command,[string],[clear]) -function IssueUnitCommand(unitList, command, [string], [clear]) +---comment +---@param unitList any +---@param command any +---@param string any? +---@param clear boolean? +function IssueUnitCommand(unitList, command, string, clear) end --- @@ -713,7 +762,9 @@ end --- -- Random([[min,] max]) -function Random([[min, ] max]) +---@param min number? +---@param max number? +function Random(min, max) end --- @@ -733,12 +784,16 @@ end --- -- RemoveProfileDirectories(string profile) - Removes the profile directory and all special files -function RemoveProfileDirectories(string profile) +---@param profile string +function RemoveProfileDirectories(profile) end --- -- RemoveSpecialFile(string profilename, string basename, string type) - remove a profile based file from the disc -function RemoveSpecialFile(string profilename, string basename, string type) +---@param profilename string +---@param basename string +---@param type string +function RemoveSpecialFile(profilename, basename, type) end --- @@ -843,7 +898,10 @@ end --- -- SessionSendChatMessage([client-or-clients,] message) -function SessionSendChatMessage([client-or-clients, ] message) +---comment +---@param client table|number client or clients +---@param message any +function SessionSendChatMessage(client, message) end --- @@ -878,7 +936,8 @@ end --- -- SetFocusArmy(armyIndex or -1) -function SetFocusArmy(armyIndex or -1) +---@param armyIndex number index or -1 +function SetFocusArmy(armyIndex) end --- @@ -918,7 +977,8 @@ end --- -- SetUIControlsAlpha(float alpha) -- set the alpha multiplier for 2d UI controls -function SetUIControlsAlpha(float alpha) +---@param alpha number float +function SetUIControlsAlpha(alpha) end --- @@ -955,17 +1015,17 @@ end --- -- SyncPlayableRect -function INFO: StopSound(handle,[immediate=false])() +function INFO: StopSound(handle,[immediate=false]) end --- -- TeamColorMode -function INFO: SyncPlayableRect(region)() +function INFO: SyncPlayableRect(region) end --- -- ToggleFireState -function INFO: TeamColorMode(bool)() +function INFO: TeamColorMode(bool) end --- diff --git a/engine/User/CLobby.lua b/engine/User/CLobby.lua index e84baad34c..f5161329af 100644 --- a/engine/User/CLobby.lua +++ b/engine/User/CLobby.lua @@ -1,5 +1,6 @@ ---- Class CLobby --- @classmod User.CLobby +---@declare-global +---@class moho.lobby_methods +local CLobby = {} --- -- void CLobby.ConnectToPeer(self,address,name,uid @@ -86,8 +87,5 @@ end function CLobby:SendData(self, targetID, table) end ---- --- -function CLobby:moho.lobby_methods() -end +return CLobby diff --git a/engine/User/CMauiBitmap.lua b/engine/User/CMauiBitmap.lua index 27c9f556a2..4c1609a7c2 100644 --- a/engine/User/CMauiBitmap.lua +++ b/engine/User/CMauiBitmap.lua @@ -1,5 +1,6 @@ ---- Class CMauiBitmap --- @classmod User.CMauiBitmap +---@declare-global +---@class moho.bitmap_methods +local CMauiBitmap = {} --- -- GetNumFrames() @@ -53,7 +54,7 @@ end --- -- Bitmap:SetNewTexture(filename(s), border=1) -function CMauiBitmap:SetNewTexture(filename(s) +function CMauiBitmap:SetNewTexture(filenames) end --- @@ -66,9 +67,12 @@ end function CMauiBitmap:SetTiled(bool) end ---- --- Bitmap:SetUV(float u0, float v0, float u1, float v1) -function CMauiBitmap:SetUV(float u0, float v0, float u1, float v1) +---todo +---@param u0 number float +---@param v0 number float +---@param u1 number float +---@param v1 number float +function CMauiBitmap:SetUV(u0, v0, u1, v1) end --- @@ -91,8 +95,4 @@ end function CMauiBitmap:base() end ---- --- -function CMauiBitmap:moho.bitmap_methods() -end - +return CMauiBitmap diff --git a/engine/User/CMauiControl.lua b/engine/User/CMauiControl.lua index 752f43c3d5..c1fa8455b0 100644 --- a/engine/User/CMauiControl.lua +++ b/engine/User/CMauiControl.lua @@ -1,9 +1,9 @@ ---- Class CMauiControl --- @classmod User.CMauiControl +---@declare-global +---@class moho.control_methods +local CMauiControl = {} ---- --- AcquireKeyboardFocus(bool blocksKeyDown) -function CMauiControl:AcquireKeyboardFocus(bool blocksKeyDown) +---@param blocksKeyDown boolean +function CMauiControl:AcquireKeyboardFocus(blocksKeyDown) end --- @@ -21,9 +21,9 @@ end function CMauiControl:Destroy() end ---- --- Control:DisableHitTest([recursive]) -- hit testing will be skipped for this control -function CMauiControl:DisableHitTest([recursive]) +---hit testing will be skipped for this control +---@param recursive boolean? +function CMauiControl:DisableHitTest(recursive) end --- @@ -31,9 +31,9 @@ end function CMauiControl:Dump() end ---- --- Control:EnableHitTest([recursive]) -- hit testing will be checked for this control -function CMauiControl:EnableHitTest([recursive]) +---hit testing will be checked for this control +---@param recursive boolean? +function CMauiControl:EnableHitTest(recursive) end --- @@ -106,9 +106,8 @@ end function CMauiControl:SetName(string) end ---- --- SetNeedsFrameUpdate(bool needsIt) -function CMauiControl:SetNeedsFrameUpdate(bool needsIt) +---@param needsIt boolean +function CMauiControl:SetNeedsFrameUpdate(needsIt) end --- @@ -126,8 +125,4 @@ end function CMauiControl:Show() end ---- --- -function CMauiControl:moho.control_methods() -end - +return CMauiControl diff --git a/engine/User/CMauiCursor.lua b/engine/User/CMauiCursor.lua index fc2c18ad76..74ec2bd4af 100644 --- a/engine/User/CMauiCursor.lua +++ b/engine/User/CMauiCursor.lua @@ -1,5 +1,6 @@ ---- Class CMauiCursor --- @classmod User.CMauiCursor +---@declare-global +---@class moho.cursor_methods +local CMauiCursor = {} --- -- Cursor:ResetToDefault() @@ -21,8 +22,4 @@ end function CMauiCursor:Show() end ---- --- -function CMauiCursor:moho.cursor_methods() -end - +return CMauiCursor diff --git a/engine/User/CMauiEdit.lua b/engine/User/CMauiEdit.lua index 1ce9a17bf3..cc7b4f8650 100644 --- a/engine/User/CMauiEdit.lua +++ b/engine/User/CMauiEdit.lua @@ -1,5 +1,6 @@ ---- Class CMauiEdit --- @classmod User.CMauiEdit +---@declare-global +---@class moho.edit_methods +local CMauiEdit = {} --- -- AcquireFocus() @@ -156,8 +157,4 @@ end function CMauiEdit:base() end ---- --- -function CMauiEdit:moho.edit_methods() -end - +return CMauiEdit diff --git a/engine/User/CMauiFrame.lua b/engine/User/CMauiFrame.lua index b6948fdb4e..38ca864192 100644 --- a/engine/User/CMauiFrame.lua +++ b/engine/User/CMauiFrame.lua @@ -1,5 +1,6 @@ ---- Class CMauiFrame --- @classmod User.CMauiFrame +---@declare-global +---@class moho.frame_methods +local CMauiFrame = {} --- -- float GetTopmostDepth() @@ -16,8 +17,4 @@ end function CMauiFrame:base() end ---- --- -function CMauiFrame:moho.frame_methods() -end - +return CMauiFrame diff --git a/engine/User/CMauiItemList.lua b/engine/User/CMauiItemList.lua index e3127dbcf4..1b584007a5 100644 --- a/engine/User/CMauiItemList.lua +++ b/engine/User/CMauiItemList.lua @@ -1,6 +1,6 @@ ---- Class CMauiItemList --- @classmod User.CMauiItemList - +---@declare-global +---@class moho.item_list_methods +local CMauiItemList = {} --- -- itemlist = ItemList:DeleteAllItems() function CMauiItemList:DeleteAllItems() @@ -96,8 +96,4 @@ end function CMauiItemList:base() end ---- --- -function CMauiItemList:moho.item_list_methods() -end - +return CMauiItemList diff --git a/engine/User/CMauiText.lua b/engine/User/CMauiText.lua index dc2ba10dae..46455d16b0 100644 --- a/engine/User/CMauiText.lua +++ b/engine/User/CMauiText.lua @@ -1,5 +1,6 @@ ---- Class CMauiText --- @classmod User.CMauiText +---@declare-global +---@class moho.text_methods +local CMauiText = {} --- -- string Text:GetText() @@ -33,7 +34,7 @@ end --- -- Text:SetNewFont(family, pointsize) -function CMauiText:SetNewFont(family, pointsize) +function CMauiText:SetNewFont(family, pointsize) end --- @@ -46,8 +47,4 @@ end function CMauiText:base() end ---- --- -function CMauiText:moho.text_methods() -end - +return CMauiText diff --git a/engine/User/CUIWorldView.lua b/engine/User/CUIWorldView.lua index 225e404e33..23b1b2c3a7 100644 --- a/engine/User/CUIWorldView.lua +++ b/engine/User/CUIWorldView.lua @@ -1,5 +1,6 @@ ---- Class CUIWorldView --- @classmod User.CUIWorldView +---@declare-global +---@class moho.UIWorldView +local CUIWorldView = {} --- -- EnableResourceRendering(bool) @@ -86,8 +87,4 @@ end function CUIWorldView:base() end ---- --- -function CUIWorldView:moho.UIWorldView() -end - +return CUIWorldView diff --git a/engine/User/UserUnit.lua b/engine/User/UserUnit.lua index 114fb2e5ce..0fec0b9c77 100644 --- a/engine/User/UserUnit.lua +++ b/engine/User/UserUnit.lua @@ -1,4 +1,4 @@ ---- Class UserUnit +---@class UserUnit -- @classmod User.UserUnit --- diff --git a/engine/moho.lua b/engine/moho.lua new file mode 100644 index 0000000000..96f2b8c783 --- /dev/null +++ b/engine/moho.lua @@ -0,0 +1,37 @@ +---@meta +--- none of this code is executed, it is for example only +---@declare-global +moho = { + -- sim + + aibrain_methods = require('/engine/sim/caibrain.lua'), + entity_methods = require('/engine/sim/entity.lua'), + unit_methods = require('/engine/sim/unit.lua'), + projectile_methods = require('/engine/sim/projectile.lua'), + prop_methods = require('/engine/sim/prop.lua'), + shield_methods = require('/engine/sim/shield.lua'), + weapon_methods = require('/engine/sim/unitweapon.lua'), + platoon_methods = require('/engine/sim/cplatoon.lua'), + CollisionBeamEntity = require('/engine/sim/collisionbeamentity.lua'), + SlideManipulator = require('/engine/sim/cslidemanipulator.lua'), + IEffect = require('/engine/sim/ieffect.lua'), + + manipulator_methods = require('/engine/sim/ianimanipulator.lua'), + BuilderArmManipulator = require('/engine/sim/cbuilderarmmanipulator.lua'), + AimManipulator = require('/engine/sim/caimmanipulator.lua'), + AnimationManipulator = require('/engine/sim/canimationmanipulator.lua'), + CollisionManipulator = require('/engine/sim/ccollisionmanipulator.lua'), + RotateManipulator = require('/engine/sim/crotatemanipulator.lua'), + + -- user + + control_methods = require('/engine/user/cmauicontrol.lua'), + edit_methods = require('/engine/user/cmauiedit.lua'), + frame_methods = require('/engine/user/cmauiframe.lua'), + text_methods = require('/engine/user/cmauitext.lua'), + item_list_methods = require('/engine/user/cmauiitemlist.lua'), + bitmap_methods = require('/engine/user/cmauibitmap.lua'), + cursor_methods = require('/engine/user/cmauicursor.lua'), + UIWorldView = require('/engine/user/cuiworldview.lua'), + lobby_methods = require('/engine/user/clobby.lua') +} diff --git a/lua/AI/AttackManager.lua b/lua/AI/AttackManager.lua index bfe1163326..f13a25e2ad 100644 --- a/lua/AI/AttackManager.lua +++ b/lua/AI/AttackManager.lua @@ -26,7 +26,8 @@ local Utilities = import('/lua/utilities.lua') -- AMPlatoons = { AMPlatoonName, AMPlatoonName, etc }, -- }, -AttackManager = Class({ +---@class AttackManager +AttackManager = ClassSimple({ brain = nil, NeedSort = false, PlatoonCount = { DefaultGroupAir = 0, DefaultGroupLand = 0, DefaultGroupSea = 0, }, diff --git a/lua/AI/aiutilities.lua b/lua/AI/aiutilities.lua index 3d10c02437..3f21816d48 100644 --- a/lua/AI/aiutilities.lua +++ b/lua/AI/aiutilities.lua @@ -14,6 +14,7 @@ local Buff = import('/lua/sim/Buff.lua') local SUtils = import('/lua/AI/sorianutilities.lua') local AIBehaviors = import('/lua/ai/AIBehaviors.lua') +---@param aiBrain AIBrain function AIGetEconomyNumbers(aiBrain) local econ = {} econ.MassTrend = aiBrain:GetEconomyTrend('MASS') diff --git a/lua/SimSync.lua b/lua/SimSync.lua index 9c9651ee45..45d86e65ae 100644 --- a/lua/SimSync.lua +++ b/lua/SimSync.lua @@ -1,3 +1,4 @@ +---@declare-global -- The global sync table is copied to the user layer every time the main and sim threads are -- synchronized on the sim beat (which is like a tick but happens even when the game is paused) Sync = {} diff --git a/lua/aeonprojectiles.lua b/lua/aeonprojectiles.lua index 4ddf8351d5..8b3c164d6b 100644 --- a/lua/aeonprojectiles.lua +++ b/lua/aeonprojectiles.lua @@ -28,6 +28,7 @@ local NukeProjectile = DefaultProjectileFile.NukeProjectile -------------------------------------------------------------------------- -- AEON ANTI-NUKE PROJECTILES -------------------------------------------------------------------------- +---@class ASaintAntiNuke : SinglePolyTrailProjectile ASaintAntiNuke = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/aeon_missile_trail_02_emit.bp', FxTrails = {'/effects/emitters/saint_munition_01_emit.bp'}, @@ -44,6 +45,7 @@ ASaintAntiNuke = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON Ballistic Mortar Launcher -------------------------------------------------------------------------- +---@class AIFBallisticMortarProjectile : EmitterProjectile AIFBallisticMortarProjectile = Class(EmitterProjectile) { FxTrails = EffectTemplate.AQuarkBomb01, @@ -55,6 +57,7 @@ AIFBallisticMortarProjectile = Class(EmitterProjectile) { FxImpactUnderWater = {}, } +---@class AIFBallisticMortarProjectile02 : MultiPolyTrailProjectile AIFBallisticMortarProjectile02 = Class(MultiPolyTrailProjectile) { PolyTrails = EffectTemplate.AIFBallisticMortarTrails02, PolyTrailOffset = {0,0}, @@ -72,6 +75,7 @@ AIFBallisticMortarProjectile02 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON ARTILLERY PROJECTILES -------------------------------------------------------------------------- +---@class AArtilleryProjectile : EmitterProjectile AArtilleryProjectile = Class(EmitterProjectile) { FxTrails = EffectTemplate.AIFBallisticMortarTrails01, FxTrailScale = 0.75, @@ -87,6 +91,7 @@ AArtilleryProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON BEAM PROJECTILES -------------------------------------------------------------------------- +---@class ABeamProjectile : NullShell ABeamProjectile = Class(NullShell) { -- Hit Effects @@ -100,6 +105,7 @@ ABeamProjectile = Class(NullShell) { -------------------------------------------------------------------------- -- AEON GRAVITON BOMB -------------------------------------------------------------------------- +---@class AGravitonBombProjectile : SinglePolyTrailProjectile AGravitonBombProjectile = Class(SinglePolyTrailProjectile) { -- T1 bomber PolyTrail = '/effects/emitters/default_polytrail_03_emit.bp', FxTrails = {'/effects/emitters/torpedo_munition_trail_01_emit.bp',}, @@ -114,6 +120,7 @@ AGravitonBombProjectile = Class(SinglePolyTrailProjectile) { -- T1 bomber -------------------------------------------------------------------------- -- AEON SHIP PROJECTILES -------------------------------------------------------------------------- +---@class ACannonSeaProjectile : SingleBeamProjectile ACannonSeaProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/cannon_munition_ship_aeon_beam_01_emit.bp', @@ -124,6 +131,7 @@ ACannonSeaProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- AEON TANK PROJECTILES -------------------------------------------------------------------------- +---@class ACannonTankProjectile : SingleBeamProjectile ACannonTankProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/cannon_munition_ship_aeon_beam_01_emit.bp', -- PolyTrails = {'cannon_polytrail_01'}, @@ -142,6 +150,7 @@ ACannonTankProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- AEON DEPTH CHARGE -------------------------------------------------------------------------- +---@class ADepthChargeProjectile : OnWaterEntryEmitterProjectile ADepthChargeProjectile = Class(OnWaterEntryEmitterProjectile) { FxInitial = {}, FxTrails = {'/effects/emitters/torpedo_munition_trail_01_emit.bp',}, @@ -169,6 +178,7 @@ ADepthChargeProjectile = Class(OnWaterEntryEmitterProjectile) { -------------------------------------------------------------------------- -- AEON ARTILLERY PROJECTILES -------------------------------------------------------------------------- +---@class AGravitonProjectile : EmitterProjectile AGravitonProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/graviton_munition_trail_01_emit.bp',}, @@ -184,6 +194,7 @@ AGravitonProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON LASER PROJECTILES -------------------------------------------------------------------------- +---@class AHighIntensityLaserProjectile : SinglePolyTrailProjectile AHighIntensityLaserProjectile = Class(SinglePolyTrailProjectile) { FxTrails = { @@ -202,6 +213,7 @@ AHighIntensityLaserProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON FLARE PROJECTILES -------------------------------------------------------------------------- +---@class AIMFlareProjectile : EmitterProjectile AIMFlareProjectile = Class(EmitterProjectile) { FxTrails = EffectTemplate.AAntiMissileFlare, FxTrailScale = 1.0, @@ -224,6 +236,7 @@ AIMFlareProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON LASER PROJECTILES -------------------------------------------------------------------------- +---@class ALaserBotProjectile : SinglePolyTrailProjectile ALaserBotProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/aeon_laser_trail_01_emit.bp', @@ -235,6 +248,7 @@ ALaserBotProjectile = Class(SinglePolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class ALaserProjectile : SingleBeamProjectile ALaserProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/laserturret_munition_beam_02_emit.bp', @@ -246,6 +260,7 @@ ALaserProjectile = Class(SingleBeamProjectile) { FxImpactUnderWater = {}, } +---@class AQuadLightLaserProjectile : MultiPolyTrailProjectile AQuadLightLaserProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = { @@ -273,6 +288,7 @@ AQuadLightLaserProjectile = Class(MultiPolyTrailProjectile) { +---@class ALightLaserProjectile : MultiPolyTrailProjectile ALightLaserProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = { @@ -288,6 +304,7 @@ ALightLaserProjectile = Class(MultiPolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class ASonicPulsarProjectile : EmitterProjectile ASonicPulsarProjectile = Class(EmitterProjectile){ FxTrails = EffectTemplate.ASonicPulsarMunition01, } @@ -296,12 +313,14 @@ ASonicPulsarProjectile = Class(EmitterProjectile){ -------------------------------------------------------------------------- -- AEON ARTILLERY PROJECTILES -------------------------------------------------------------------------- +---@class AMiasmaProjectile : EmitterProjectile AMiasmaProjectile = Class(EmitterProjectile) { FxTrails = EffectTemplate.AMiasmaMunition01, FxImpactNone = EffectTemplate.AMiasma01, } +---@class AMiasmaProjectile02 : EmitterProjectile AMiasmaProjectile02 = Class(EmitterProjectile) { FxTrails = EffectTemplate.AMiasmaMunition02, FxImpactLand = EffectTemplate.AMiasmaField01, @@ -312,6 +331,7 @@ AMiasmaProjectile02 = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON AA MISSILE PROJECTILES -------------------------------------------------------------------------- +---@class AMissileAAProjectile : SinglePolyTrailProjectile AMissileAAProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/aeon_missile_trail_01_emit.bp', @@ -323,6 +343,7 @@ AMissileAAProjectile = Class(SinglePolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class AZealot02AAMissileProjectile : SinglePolyTrailProjectile AZealot02AAMissileProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/aeon_missile_trail_03_emit.bp', @@ -334,6 +355,7 @@ AZealot02AAMissileProjectile = Class(SinglePolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class AAALightDisplacementAutocannonMissileProjectile : MultiPolyTrailProjectile AAALightDisplacementAutocannonMissileProjectile = Class(MultiPolyTrailProjectile) { FxImpactUnit = EffectTemplate.ALightDisplacementAutocannonMissileHit, FxImpactAirUnit = EffectTemplate.ALightDisplacementAutocannonMissileHitUnit, @@ -348,6 +370,7 @@ AAALightDisplacementAutocannonMissileProjectile = Class(MultiPolyTrailProjectile -------------------------------------------------------------------------- -- AEON GUIDED MISSILE PROJECTILES -------------------------------------------------------------------------- +---@class AGuidedMissileProjectile : SinglePolyTrailProjectile AGuidedMissileProjectile = Class(SinglePolyTrailProjectile) { FxTrails = EffectTemplate.AMercyGuidedMissileFxTrails, PolyTrail = EffectTemplate.AMercyGuidedMissilePolyTrail, -- '/effects/emitters/aeon_missile_trail_02_emit.bp', @@ -362,6 +385,7 @@ AGuidedMissileProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON SUB-LAUNCHED CRUISE MISSILE PROJECTILES -------------------------------------------------------------------------- +---@class AMissileCruiseSubProjectile : EmitterProjectile AMissileCruiseSubProjectile = Class(EmitterProjectile) { FxInitialAtEntityEmitter = {}, FxUnderWaterTrail = {'/effects/emitters/missile_cruise_munition_underwater_trail_01_emit.bp',}, @@ -391,6 +415,7 @@ AMissileCruiseSubProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON SERPENTINE MISSILE PROJECTILES -------------------------------------------------------------------------- +---@class AMissileSerpentineProjectile : SingleCompositeEmitterProjectile AMissileSerpentineProjectile = Class(SingleCompositeEmitterProjectile) { PolyTrail = '/effects/emitters/serpentine_missile_trail_emit.bp', BeamName = '/effects/emitters/serpentine_missle_exhaust_beam_01_emit.bp', @@ -408,6 +433,7 @@ AMissileSerpentineProjectile = Class(SingleCompositeEmitterProjectile) { end, } +---@class AMissileSerpentine02Projectile : SingleCompositeEmitterProjectile AMissileSerpentine02Projectile = Class(SingleCompositeEmitterProjectile) { PolyTrail = '/effects/emitters/serpentine_missile_trail_emit.bp', BeamName = '/effects/emitters/serpentine_missle_exhaust_beam_01_emit.bp', @@ -428,6 +454,7 @@ AMissileSerpentine02Projectile = Class(SingleCompositeEmitterProjectile) { -------------------------------------------------------------------------- -- AEON OBLIVION PROJECILE -------------------------------------------------------------------------- +---@class AOblivionCannonProjectile : EmitterProjectile AOblivionCannonProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/oblivion_cannon_munition_01_emit.bp'}, FxImpactUnit = EffectTemplate.AOblivionCannonHit01, @@ -436,6 +463,7 @@ AOblivionCannonProjectile = Class(EmitterProjectile) { FxImpactWater = EffectTemplate.AOblivionCannonHit01, } +---@class AOblivionCannonProjectile02 : SinglePolyTrailProjectile AOblivionCannonProjectile02 = Class(SinglePolyTrailProjectile) { FxImpactTrajectoryAligned = false, FxTrails = EffectTemplate.AOblivionCannonFXTrails02, @@ -446,6 +474,7 @@ AOblivionCannonProjectile02 = Class(SinglePolyTrailProjectile) { FxImpactWater = EffectTemplate.AOblivionCannonHit02, } +---@class AOblivionCannonProjectile03 : EmitterProjectile AOblivionCannonProjectile03 = Class(EmitterProjectile) { FxTrails = EffectTemplate.AOblivionCannonFXTrails03, FxImpactUnit = EffectTemplate.AOblivionCannonHit03, @@ -457,6 +486,7 @@ AOblivionCannonProjectile03 = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON QUANTUM PROJECTILES -------------------------------------------------------------------------- +---@class AQuantumCannonProjectile : SinglePolyTrailProjectile AQuantumCannonProjectile = Class(SinglePolyTrailProjectile) { FxTrails = { '/effects/emitters/quantum_cannon_munition_03_emit.bp', @@ -468,6 +498,7 @@ AQuantumCannonProjectile = Class(SinglePolyTrailProjectile) { FxImpactLand = EffectTemplate.AQuantumDisruptorHit01, } +---@class AQuantumDisruptorProjectile : SinglePolyTrailProjectile AQuantumDisruptorProjectile = Class(SinglePolyTrailProjectile) { -- ACU PolyTrail = '/effects/emitters/default_polytrail_03_emit.bp', FxTrails = EffectTemplate.AQuantumDisruptor01, @@ -480,6 +511,7 @@ AQuantumDisruptorProjectile = Class(SinglePolyTrailProjectile) { -- ACU -------------------------------------------------------------------------- -- AEON AA PROJECTILES -------------------------------------------------------------------------- +---@class AAAQuantumDisplacementCannonProjectile : NullShell AAAQuantumDisplacementCannonProjectile = Class(NullShell) { -- Projectile Effects @@ -559,6 +591,7 @@ AQuantumWarheadProjectile = Class(NukeProjectile, MultiCompositeEmitterProjectil -------------------------------------------------------------------------- -- AEON QUARK BOMB -------------------------------------------------------------------------- +---@class AQuarkBombProjectile : EmitterProjectile AQuarkBombProjectile = Class(EmitterProjectile) { -- Strategic bomber FxTrails = EffectTemplate.AQuarkBomb01, FxTrailScale = 1, @@ -581,6 +614,7 @@ AQuarkBombProjectile = Class(EmitterProjectile) { -- Strategic bomber -------------------------------------------------------------------------- -- AEON RAIL GUN PROJECTILES -------------------------------------------------------------------------- +---@class ARailGunProjectile : EmitterProjectile ARailGunProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/railgun_munition_trail_02_emit.bp', '/effects/emitters/railgun_munition_trail_01_emit.bp'}, @@ -593,6 +627,7 @@ ARailGunProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON REACTON CANNON PROJECTILES -------------------------------------------------------------------------- +---@class AReactonCannonProjectile : EmitterProjectile AReactonCannonProjectile = Class(EmitterProjectile) { --SCU FxTrails = { '/effects/emitters/reacton_cannon_fxtrail_01_emit.bp', @@ -605,6 +640,7 @@ AReactonCannonProjectile = Class(EmitterProjectile) { --SCU FxImpactLand = EffectTemplate.AReactonCannonHitLand01, } +---@class AReactonCannonAOEProjectile : EmitterProjectile AReactonCannonAOEProjectile = Class(EmitterProjectile) { FxTrails = { '/effects/emitters/reacton_cannon_fxtrail_01_emit.bp', @@ -620,6 +656,7 @@ AReactonCannonAOEProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON DISRUPTOR PROJECTILES -------------------------------------------------------------------------- +---@class ADisruptorProjectile : SinglePolyTrailProjectile ADisruptorProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/default_polytrail_03_emit.bp', @@ -632,6 +669,7 @@ ADisruptorProjectile = Class(SinglePolyTrailProjectile) { FxImpactShield = EffectTemplate.ADisruptorHitShield, } +---@class AShieldDisruptorProjectile : SinglePolyTrailProjectile AShieldDisruptorProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = EffectTemplate.ASDisruptorPolytrail01, @@ -647,6 +685,7 @@ AShieldDisruptorProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON ROCKET PROJECTILES -------------------------------------------------------------------------- +---@class ARocketProjectile : EmitterProjectile ARocketProjectile = Class(EmitterProjectile) { FxInitial = {}, @@ -663,6 +702,7 @@ ARocketProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- AEON SONIC PULSE AA PROJECTILES -------------------------------------------------------------------------- +---@class ASonicPulseProjectile : SinglePolyTrailProjectile ASonicPulseProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/sonic_pulse_munition_polytrail_01_emit.bp', @@ -675,6 +715,7 @@ ASonicPulseProjectile = Class(SinglePolyTrailProjectile) { } -- Custom version of the sonic pulse battery projectile for flying units +---@class ASonicPulseProjectile02 : SinglePolyTrailProjectile ASonicPulseProjectile02 = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/sonic_pulse_munition_polytrail_02_emit.bp', @@ -689,6 +730,7 @@ ASonicPulseProjectile02 = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON FIZZ LAUNCHER PROJECTILE -------------------------------------------------------------------------- +---@class ATemporalFizzAAProjectile : SingleCompositeEmitterProjectile ATemporalFizzAAProjectile = Class(SingleCompositeEmitterProjectile) { BeamName = '/effects/emitters/temporal_fizz_munition_beam_01_emit.bp', PolyTrail = '/effects/emitters/default_polytrail_03_emit.bp', @@ -700,6 +742,7 @@ ATemporalFizzAAProjectile = Class(SingleCompositeEmitterProjectile) { -------------------------------------------------------------------------- -- AEON ABOVE WATER LAUNCHED TORPEDO -------------------------------------------------------------------------- +---@class ATorpedoShipProjectile : OnWaterEntryEmitterProjectile ATorpedoShipProjectile = Class(OnWaterEntryEmitterProjectile) { FxInitial = {}, FxTrails = {'/effects/emitters/torpedo_munition_trail_01_emit.bp',}, @@ -739,6 +782,7 @@ ATorpedoShipProjectile = Class(OnWaterEntryEmitterProjectile) { -------------------------------------------------------------------------- -- AEON SUB LAUNCHED TORPEDO -------------------------------------------------------------------------- +---@class ATorpedoSubProjectile : EmitterProjectile ATorpedoSubProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/torpedo_munition_trail_01_emit.bp',}, @@ -759,6 +803,7 @@ ATorpedoSubProjectile = Class(EmitterProjectile) { } +---@class QuasarAntiTorpedoChargeSubProjectile : MultiPolyTrailProjectile QuasarAntiTorpedoChargeSubProjectile = Class(MultiPolyTrailProjectile) { FxTrails = {}, FxImpactLand = EffectTemplate.AQuasarAntiTorpedoHit, @@ -783,6 +828,7 @@ QuasarAntiTorpedoChargeSubProjectile = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SC1X AEON BASE TEMPRORARY PROJECTILE -------------------------------------------------------------------------- +---@class ABaseTempProjectile : SinglePolyTrailProjectile ABaseTempProjectile = Class(SinglePolyTrailProjectile) { FxImpactLand = EffectTemplate.AMissileHit01, FxImpactNone = EffectTemplate.AMissileHit01, @@ -800,6 +846,7 @@ ABaseTempProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON QUANTUM AUTOGUN SHELL -------------------------------------------------------------------------- +---@class AQuantumAutogun : SinglePolyTrailProjectile AQuantumAutogun = Class(SinglePolyTrailProjectile) { FxImpactLand = EffectTemplate.Aeon_DualQuantumAutoGunHitLand, FxImpactNone = EffectTemplate.Aeon_DualQuantumAutoGunHit, @@ -815,6 +862,7 @@ AQuantumAutogun = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON HEAVY DISRUPTOR CANNON SHELL -------------------------------------------------------------------------- +---@class AHeavyDisruptorCannonShell : MultiPolyTrailProjectile AHeavyDisruptorCannonShell = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.Aeon_HeavyDisruptorCannonLandHit, @@ -830,6 +878,7 @@ AHeavyDisruptorCannonShell = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- AEON TORPEDO CLUSTER -------------------------------------------------------------------------- +---@class ATorpedoCluster : ATorpedoShipProjectile ATorpedoCluster = Class(ATorpedoShipProjectile) { FxInitial = {}, FxTrails = {}, @@ -852,18 +901,21 @@ ATorpedoCluster = Class(ATorpedoShipProjectile) { -------------------------------------------------------------------------- -- AEON QUANTUM CLUSTER -------------------------------------------------------------------------- +---@class AQuantumCluster : ABaseTempProjectile AQuantumCluster = Class(ABaseTempProjectile) { } -------------------------------------------------------------------------- -- AEON LIGHT DISPLACEMENT AUTOCANNON -------------------------------------------------------------------------- +---@class ALightDisplacementAutoCannon : ABaseTempProjectile ALightDisplacementAutoCannon = Class(ABaseTempProjectile) { } -------------------------------------------------------------------------- -- AEON ARTILLERY FRAGMENTATION SENSOR SHELL -------------------------------------------------------------------------- +---@class AArtilleryFragmentationSensorShellProjectile : SinglePolyTrailProjectile AArtilleryFragmentationSensorShellProjectile = Class(SinglePolyTrailProjectile) { -- FxTrails = {}, FxTrails = EffectTemplate.Aeon_QuanticClusterProjectileTrails, @@ -875,6 +927,7 @@ AArtilleryFragmentationSensorShellProjectile = Class(SinglePolyTrailProjectile) -------------------------------------------------------------------------- -- AEON ARTILLERY FRAGMENTATION SENSOR SHELL 02 (split 1) -------------------------------------------------------------------------- +---@class AArtilleryFragmentationSensorShellProjectile02 : AArtilleryFragmentationSensorShellProjectile AArtilleryFragmentationSensorShellProjectile02 = Class(AArtilleryFragmentationSensorShellProjectile) { FxTrails = EffectTemplate.Aeon_QuanticClusterProjectileTrails02, PolyTrail = EffectTemplate.Aeon_QuanticClusterProjectilePolyTrail02, @@ -883,6 +936,7 @@ AArtilleryFragmentationSensorShellProjectile02 = Class(AArtilleryFragmentationSe -------------------------------------------------------------------------- -- AEON ARTILLERY FRAGMENTATION SENSOR SHELL 03 (split 2) -------------------------------------------------------------------------- +---@class AArtilleryFragmentationSensorShellProjectile03 : AArtilleryFragmentationSensorShellProjectile AArtilleryFragmentationSensorShellProjectile03 = Class(AArtilleryFragmentationSensorShellProjectile) { FxTrails = {}, PolyTrail = EffectTemplate.Aeon_QuanticClusterProjectilePolyTrail03, diff --git a/lua/aeonunits.lua b/lua/aeonunits.lua index ab184ed863..fca9d81bad 100644 --- a/lua/aeonunits.lua +++ b/lua/aeonunits.lua @@ -44,6 +44,7 @@ local CreateAeonFactoryBuildingEffects = EffectUtil.CreateAeonFactoryBuildingEff --------------------------------------------------------------- -- FACTORIES --------------------------------------------------------------- +---@class AFactoryUnit : FactoryUnit AFactoryUnit = Class(FactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) local thread = self:ForkThread(CreateAeonFactoryBuildingEffects, unitBeingBuilt, self.BuildEffectBones, 'Attachpoint', self.BuildEffectsBag) @@ -71,6 +72,7 @@ AFactoryUnit = Class(FactoryUnit) { --------------------------------------------------------------- -- AIR STRUCTURES --------------------------------------------------------------- +---@class AAirFactoryUnit : AirFactoryUnit AAirFactoryUnit = Class(AirFactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) AFactoryUnit.StartBuildFx(self, unitBeingBuilt) @@ -88,16 +90,19 @@ AAirFactoryUnit = Class(AirFactoryUnit) { --------------------------------------------------------------- -- AIR UNITS --------------------------------------------------------------- +---@class AAirUnit : AirUnit AAirUnit = Class(AirUnit) {} --------------------------------------------------------------- -- AIR STAGING STRUCTURES --------------------------------------------------------------- +---@class AAirStagingPlatformUnit : AirStagingPlatformUnit AAirStagingPlatformUnit = Class(AirStagingPlatformUnit) {} --------------------------------------------------------------- -- WALL STRUCTURES --------------------------------------------------------------- +---@class AConcreteStructureUnit : ConcreteStructureUnit AConcreteStructureUnit = Class(ConcreteStructureUnit) { AdjacencyBeam = false, } @@ -105,6 +110,7 @@ AConcreteStructureUnit = Class(ConcreteStructureUnit) { --------------------------------------------------------------- -- Construction Units --------------------------------------------------------------- +---@class AConstructionUnit : ConstructionUnit AConstructionUnit = Class(ConstructionUnit) { CreateBuildEffects = function(self, unitBeingBuilt, order) EffectUtil.CreateAeonConstructionUnitBuildingEffects(self, unitBeingBuilt, self.BuildEffectsBag) @@ -114,6 +120,7 @@ AConstructionUnit = Class(ConstructionUnit) { --------------------------------------------------------------- -- ENERGY CREATION UNITS --------------------------------------------------------------- +---@class AEnergyCreationUnit : EnergyCreationUnit AEnergyCreationUnit = Class(EnergyCreationUnit) { OnCreate = function(self) EnergyCreationUnit.OnCreate(self) @@ -133,6 +140,7 @@ AEnergyCreationUnit = Class(EnergyCreationUnit) { --------------------------------------------------------------- -- ENERGY STORAGE STRUCTURES --------------------------------------------------------------- +---@class AEnergyStorageUnit : EnergyStorageUnit AEnergyStorageUnit = Class(EnergyStorageUnit) {} --------------------------------------------------------------- @@ -147,6 +155,7 @@ AHoverLandUnit = Class(DefaultUnitsFile.HoverLandUnit) { --------------------------------------------------------------- -- LAND FACTORY STRUCTURES --------------------------------------------------------------- +---@class ALandFactoryUnit : LandFactoryUnit ALandFactoryUnit = Class(LandFactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) AFactoryUnit.StartBuildFx(self, unitBeingBuilt) @@ -169,31 +178,37 @@ ALandUnit = Class(DefaultUnitsFile.LandUnit) {} --------------------------------------------------------------- -- MASS COLLECTION UNITS --------------------------------------------------------------- +---@class AMassCollectionUnit : MassCollectionUnit AMassCollectionUnit = Class(MassCollectionUnit) {} --------------------------------------------------------------- -- MASS FABRICATION STRUCTURES --------------------------------------------------------------- +---@class AMassFabricationUnit : MassFabricationUnit AMassFabricationUnit = Class(MassFabricationUnit) {} --------------------------------------------------------------- -- MASS STORAGE UNITS --------------------------------------------------------------- +---@class AMassStorageUnit : MassStorageUnit AMassStorageUnit = Class(MassStorageUnit) {} --------------------------------------------------------------- -- RADAR STRUCTURES --------------------------------------------------------------- +---@class ARadarUnit : RadarUnit ARadarUnit = Class(RadarUnit) {} --------------------------------------------------------------- -- RADAR STRUCTURES --------------------------------------------------------------- +---@class ASonarUnit : SonarUnit ASonarUnit = Class(SonarUnit) {} --------------------------------------------------------------- -- SEA FACTORY STRUCTURES --------------------------------------------------------------- +---@class ASeaFactoryUnit : SeaFactoryUnit ASeaFactoryUnit = Class(SeaFactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) local thread = self:ForkThread(CreateAeonFactoryBuildingEffects, unitBeingBuilt, self.BuildEffectBones, 'Attachpoint01', self.BuildEffectsBag) @@ -217,16 +232,19 @@ ASeaUnit = Class(DefaultUnitsFile.SeaUnit) {} --------------------------------------------------------------- -- SHIELD LAND UNITS --------------------------------------------------------------- +---@class AShieldHoverLandUnit : ShieldHoverLandUnit AShieldHoverLandUnit = Class(ShieldHoverLandUnit) {} --------------------------------------------------------------- -- SHIELD LAND UNITS --------------------------------------------------------------- +---@class AShieldLandUnit : ShieldLandUnit AShieldLandUnit = Class(ShieldLandUnit) {} --------------------------------------------------------------- -- SHIELD STRUCTURES --------------------------------------------------------------- +---@class AShieldStructureUnit : ShieldStructureUnit AShieldStructureUnit = Class(ShieldStructureUnit) { RotateSpeed = 60, @@ -251,6 +269,7 @@ AShieldStructureUnit = Class(ShieldStructureUnit) { --------------------------------------------------------------- -- STRUCTURES --------------------------------------------------------------- +---@class AStructureUnit : StructureUnit AStructureUnit = Class(StructureUnit) {} --------------------------------------------------------------- @@ -264,31 +283,37 @@ ASubUnit = Class(DefaultUnitsFile.SubUnit) { --------------------------------------------------------------- -- TRANSPORT BEACON UNITS --------------------------------------------------------------- +---@class ATransportBeaconUnit : TransportBeaconUnit ATransportBeaconUnit = Class(TransportBeaconUnit) {} --------------------------------------------------------------- -- WALKING LAND UNITS --------------------------------------------------------------- +---@class AWalkingLandUnit : WalkingLandUnit AWalkingLandUnit = Class(WalkingLandUnit) {} --------------------------------------------------------------- -- WALL STRUCTURES --------------------------------------------------------------- +---@class AWallStructureUnit : WallStructureUnit AWallStructureUnit = Class(WallStructureUnit) {} --------------------------------------------------------------- -- CIVILIAN STRUCTURES --------------------------------------------------------------- +---@class ACivilianStructureUnit : AStructureUnit ACivilianStructureUnit = Class(AStructureUnit) {} --------------------------------------------------------------- -- QUANTUM GATE UNITS --------------------------------------------------------------- +---@class AQuantumGateUnit : QuantumGateUnit AQuantumGateUnit = Class(QuantumGateUnit) {} --------------------------------------------------------------- -- RADAR JAMMER UNITS --------------------------------------------------------------- +---@class ARadarJammerUnit : RadarJammerUnit ARadarJammerUnit = Class(RadarJammerUnit) { RotateSpeed = 60, diff --git a/lua/aeonweapons.lua b/lua/aeonweapons.lua index 6f55c99d3d..8db6315561 100644 --- a/lua/aeonweapons.lua +++ b/lua/aeonweapons.lua @@ -22,10 +22,12 @@ local DefaultBeamWeapon = WeaponFile.DefaultBeamWeapon local EffectTemplate = import('/lua/EffectTemplates.lua') local EffectUtil = import('EffectUtilities.lua') +---@class AIFBallisticMortarWeapon : DefaultProjectileWeapon AIFBallisticMortarWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AIFBallisticMortarFlash02, } +---@class ADFReactonCannon : DefaultProjectileWeapon ADFReactonCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/reacton_cannon_muzzle_charge_01_emit.bp', '/effects/emitters/reacton_cannon_muzzle_charge_02_emit.bp', @@ -36,11 +38,13 @@ ADFReactonCannon = Class(DefaultProjectileWeapon) { }, } +---@class ADFOverchargeWeapon : OverchargeWeapon ADFOverchargeWeapon = Class(WeaponFile.OverchargeWeapon) { FxMuzzleFlash = EffectTemplate.ACommanderOverchargeFlash01, DesiredWeaponLabel = 'RightDisruptor' } +---@class ADFTractorClaw : DefaultBeamWeapon ADFTractorClaw = Class(DefaultBeamWeapon) { BeamType = TractorClawCollisionBeam, FxMuzzleFlash = {}, @@ -171,11 +175,13 @@ ADFTractorClaw = Class(DefaultBeamWeapon) { end, } +---@class ADFTractorClawStructure : DefaultBeamWeapon ADFTractorClawStructure = Class(DefaultBeamWeapon) { BeamType = TractorClawCollisionBeam, FxMuzzleFlash = {}, } +---@class ADFChronoDampener : DefaultProjectileWeapon ADFChronoDampener = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AChronoDampener, FxMuzzleFlashScale = 0.5, @@ -212,40 +218,49 @@ ADFChronoDampener = Class(DefaultProjectileWeapon) { end, } +---@class ADFQuadLaserLightWeapon : DefaultProjectileWeapon ADFQuadLaserLightWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/flash_04_emit.bp'}, } +---@class ADFLaserLightWeapon : DefaultProjectileWeapon ADFLaserLightWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/flash_04_emit.bp'}, } +---@class ADFSonicPulsarWeapon : DefaultProjectileWeapon ADFSonicPulsarWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/flash_02_emit.bp'}, FxMuzzleFlashScale = 0.5, } +---@class ADFLaserHeavyWeapon : DefaultProjectileWeapon ADFLaserHeavyWeapon = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = {}, } +---@class ADFGravitonProjectorWeapon : DefaultProjectileWeapon ADFGravitonProjectorWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AGravitonBolterMuzzleFlash01, } +---@class ADFDisruptorCannonWeapon : DefaultProjectileWeapon ADFDisruptorCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.ADisruptorCannonMuzzle01, } +---@class ADFDisruptorWeapon : DefaultProjectileWeapon ADFDisruptorWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.ASDisruptorCannonMuzzle01, FxChargeMuzzleFlash = EffectTemplate.ASDisruptorCannonChargeMuzzle01, } +---@class ADFCannonQuantumWeapon : DefaultProjectileWeapon ADFCannonQuantumWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AQuantumCannonMuzzle01, } +---@class ADFCannonOblivionWeapon : DefaultProjectileWeapon ADFCannonOblivionWeapon = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = { '/effects/emitters/oblivion_cannon_flash_01_emit.bp', @@ -254,11 +269,13 @@ ADFCannonOblivionWeapon = Class(DefaultProjectileWeapon) { }, } +---@class ADFCannonOblivionWeapon02 : DefaultProjectileWeapon ADFCannonOblivionWeapon02 = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AOblivionCannonMuzzleFlash02, FxChargeMuzzleFlash = EffectTemplate.AOblivionCannonChargeMuzzleFlash02, } +---@class ADFCannonOblivionWeapon03 : DefaultProjectileWeapon ADFCannonOblivionWeapon03 = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = { '/effects/emitters/oblivion_cannon_flash_04_emit.bp', @@ -267,12 +284,15 @@ ADFCannonOblivionWeapon03 = Class(DefaultProjectileWeapon) { }, } +---@class AIFMortarWeapon : DefaultProjectileWeapon AIFMortarWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {}, } +---@class AIFBombGravitonWeapon : DefaultProjectileWeapon AIFBombGravitonWeapon = Class(DefaultProjectileWeapon) {} +---@class AIFArtilleryMiasmaShellWeapon : DefaultProjectileWeapon AIFArtilleryMiasmaShellWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {}, @@ -299,6 +319,7 @@ AIFArtilleryMiasmaShellWeapon = Class(DefaultProjectileWeapon) { end, } +---@class AIFArtillerySonanceShellWeapon : DefaultProjectileWeapon AIFArtillerySonanceShellWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/aeon_sonance_muzzle_01_emit.bp', @@ -307,10 +328,12 @@ AIFArtillerySonanceShellWeapon = Class(DefaultProjectileWeapon) { }, } +---@class AIFBombQuarkWeapon : DefaultProjectileWeapon AIFBombQuarkWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_02_emit.bp', }, } +---@class AANDepthChargeBombWeapon : DefaultProjectileWeapon AANDepthChargeBombWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_02_emit.bp', }, @@ -339,6 +362,7 @@ AANDepthChargeBombWeapon = Class(DefaultProjectileWeapon) { end, } +---@class AANDepthChargeBombWeapon02 : DefaultProjectileWeapon AANDepthChargeBombWeapon02 = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_01_emit.bp', }, @@ -367,6 +391,7 @@ AANDepthChargeBombWeapon02 = Class(DefaultProjectileWeapon) { end, } +---@class AANTorpedoCluster : DefaultProjectileWeapon AANTorpedoCluster = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/aeon_torpedocluster_flash_01_emit.bp', }, @@ -395,6 +420,7 @@ AANTorpedoCluster = Class(DefaultProjectileWeapon) { end, } +---@class AIFSmartCharge : DefaultProjectileWeapon AIFSmartCharge = Class(DefaultProjectileWeapon) { CreateProjectileAtMuzzle = function(self, muzzle) local proj = DefaultProjectileWeapon.CreateProjectileAtMuzzle(self, muzzle) @@ -403,6 +429,7 @@ AIFSmartCharge = Class(DefaultProjectileWeapon) { end, } +---@class AANChronoTorpedoWeapon : DefaultProjectileWeapon AANChronoTorpedoWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/default_muzzle_flash_01_emit.bp', @@ -411,25 +438,31 @@ AANChronoTorpedoWeapon = Class(DefaultProjectileWeapon) { }, } +---@class AIFQuasarAntiTorpedoWeapon : DefaultProjectileWeapon AIFQuasarAntiTorpedoWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AQuasarAntiTorpedoFlash, } +---@class AKamikazeWeapon : KamikazeWeapon AKamikazeWeapon = Class(KamikazeWeapon) { FxMuzzleFlash = {}, } +---@class AIFQuantumWarhead : DefaultProjectileWeapon AIFQuantumWarhead = Class(DefaultProjectileWeapon) { } +---@class ACruiseMissileWeapon : DefaultProjectileWeapon ACruiseMissileWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/aeon_missile_launch_01_emit.bp', }, } +---@class ADFLaserHighIntensityWeapon : DefaultProjectileWeapon ADFLaserHighIntensityWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AHighIntensityLaserFlash01, } +---@class AAATemporalFizzWeapon : DefaultProjectileWeapon AAATemporalFizzWeapon = Class(DefaultProjectileWeapon) { FxChargeEffects = {'/effects/emitters/temporal_fizz_muzzle_charge_01_emit.bp', }, FxMuzzleFlash = {'/effects/emitters/temporal_fizz_muzzle_flash_01_emit.bp', }, @@ -445,35 +478,43 @@ AAATemporalFizzWeapon = Class(DefaultProjectileWeapon) { end, } +---@class AAASonicPulseBatteryWeapon : DefaultProjectileWeapon AAASonicPulseBatteryWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/sonic_pulse_muzzle_flash_01_emit.bp', }, } +---@class AAAZealotMissileWeapon : DefaultProjectileWeapon AAAZealotMissileWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CZealotLaunch01, } +---@class AAAZealot02MissileWeapon : DefaultProjectileWeapon AAAZealot02MissileWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/flash_04_emit.bp'}, } +---@class AAALightDisplacementAutocannonMissileWeapon : DefaultProjectileWeapon AAALightDisplacementAutocannonMissileWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.ALightDisplacementAutocannonMissileMuzzleFlash, } +---@class AAAAutocannonQuantumWeapon : DefaultProjectileWeapon AAAAutocannonQuantumWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/quantum_displacement_cannon_flash_01_emit.bp', }, } +---@class AIFMissileTacticalSerpentineWeapon : DefaultProjectileWeapon AIFMissileTacticalSerpentineWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/aeon_missile_launch_02_emit.bp', }, } +---@class AIFMissileTacticalSerpentine02Weapon : DefaultProjectileWeapon AIFMissileTacticalSerpentine02Weapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.ASerpFlash01, } +---@class AQuantumBeamGenerator : DefaultBeamWeapon AQuantumBeamGenerator = Class(DefaultBeamWeapon) { BeamType = QuantumBeamGeneratorCollisionBeam, @@ -491,14 +532,17 @@ AQuantumBeamGenerator = Class(DefaultBeamWeapon) { end, } +---@class AAMSaintWeapon : DefaultProjectileWeapon AAMSaintWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.ASaintLaunch01, } +---@class AAMWillOWisp : DefaultProjectileWeapon AAMWillOWisp = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.AAntiMissileFlareFlash, } +---@class ADFPhasonLaser : DefaultBeamWeapon ADFPhasonLaser = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.PhasonLaserCollisionBeam, FxMuzzleFlash = {}, @@ -519,15 +563,18 @@ ADFPhasonLaser = Class(DefaultBeamWeapon) { end, } +---@class ADFQuantumAutogunWeapon : DefaultProjectileWeapon ADFQuantumAutogunWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.Aeon_DualQuantumAutoGunMuzzleFlash, } +---@class ADFHeavyDisruptorCannonWeapon : DefaultProjectileWeapon ADFHeavyDisruptorCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.Aeon_HeavyDisruptorCannonMuzzleFlash, FxChargeMuzzleFlash = EffectTemplate.Aeon_HeavyDisruptorCannonMuzzleCharge, } +---@class AIFQuanticArtillery : DefaultProjectileWeapon AIFQuanticArtillery = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.Aeon_QuanticClusterMuzzleFlash, FxChargeMuzzleFlash = EffectTemplate.Aeon_QuanticClusterChargeMuzzleFlash, diff --git a/lua/aibrain.lua b/lua/aibrain.lua index 9cd210b8e1..31f95267f9 100644 --- a/lua/aibrain.lua +++ b/lua/aibrain.lua @@ -44,9 +44,58 @@ local Points = { local CoroutineYield = coroutine.yield +---@alias AIResult "defeat"|"draw"|"victor" +---@alias HqTech "TECH2"|"TECH3" +---@alias HqLayer "LAND"|"AIR"|"NAVY" +---@alias HqFaction "AEON"|"UEF"|"SERAPHIM"|"CYBRAN"|"NOMADS" + +---@class AIBrain: moho.aibrain_methods +---@field Trash TrashBag +---@field Result AIResult|nil +---@field UnitStats table> +---@field Name string +---@field AIPlansList table> +---@field HQs table>> +---@field EnergyExcessUnitsEnabled table +---@field EnergyExcessUnitsDisabled table +---@field EnergyDependingUnits Shield[] +---@field EnergyDependingUnitsHead number +---@field TriggerList table +---@field IntelTriggerList table +---@field UnitBuiltTriggerList table +---@field VeterancyTriggerList table +---@field PingCallbackList table +---@field BuilderManagers table +---@field ConditionsMonitor BrainConditionsMonitor +---@field BrainType "AI"|"Human" +---@field LayerPref "LAND"|"AIR" +---@field ConstantEval boolean +---@field CurrentPlan string lua file which contains plan +---@field RepeatExecution boolean +---@field CurrentPlanScript table +---@field BaseMonitor AiBaseMonitor +---@field SelfMonitor AiSelfMonitor +---@field EconomyTicksMonitor number +---@field EconomyCurrentTick number +---@field Sorian boolean +---@field EconomyData table +---@field AttackManager AttackManager +---@field AttackData AttackManager +---@field PBM AiPlatoonBuildManager +---@field HasPlatoonList boolean +---@field PlatoonNameCounter table|nil +---@field T4ThreatFound table|nil +---@field AttackPoints table|nil +---@field AirAttackPoints table|nil +---@field TacticalBases table|nil +---@field EnergyExcessThread thread +---@field IntelData table|nil +---@field targetoveride boolean AIBrain = Class(moho.aibrain_methods) { - -- HUMAN BRAIN FUNCTIONS HANDLED HERE + --- HUMAN BRAIN FUNCTIONS HANDLED HERE + ---@param self AIBrain + ---@param planName string OnCreateHuman = function(self, planName) self:CreateBrainShared(planName) self.BrainType = 'Human' @@ -55,6 +104,10 @@ AIBrain = Class(moho.aibrain_methods) { self.EnergyExcessThread = ForkThread(self.ToggleEnergyExcessUnitsThread, self) end, + ---@param self AIBrain + ---@param unitId UnitId + ---@param statName string + ---@param value number AddUnitStat = function(self, unitId, statName, value) if self.UnitStats[unitId] == nil then self.UnitStats[unitId] = {} @@ -67,6 +120,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain SetUnitStat = function(self, unitId, statName, value) if self.UnitStats[unitId] == nil then self.UnitStats[unitId] = {} @@ -75,6 +129,7 @@ AIBrain = Class(moho.aibrain_methods) { self.UnitStats[unitId][statName] = value end, + ---@param self AIBrain GetUnitStat = function(self, unitId, statName) if self.UnitStats[unitId] == nil or self.UnitStats[unitId][statName] == nil then return 0 @@ -83,10 +138,12 @@ AIBrain = Class(moho.aibrain_methods) { return self.UnitStats[unitId][statName] end, + ---@param self AIBrain GetUnitStats = function(self) return self.UnitStats end, + ---@param self AIBrain OnCreateAI = function(self, planName) self:CreateBrainShared(planName) @@ -146,25 +203,25 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Adds a HQ so that the engi mod knows we have it - -- @param self The brain itself - -- @param faction The faction (AEON / UEF / SERAPHIM / CYBRAN / NOMADS) as a string - -- @param layer The layer (LAND / AIR / NAVY) as a string - -- @param tech The tech (TECH2 / TECH3) as a string + ---@param self AIBrain + ---@param faction HqFaction The faction (AEON / UEF / SERAPHIM / CYBRAN / NOMADS) as a string + ---@param layer HqLayer The layer (LAND / AIR / NAVY) as a string + ---@param tech HqTech The tech (TECH2 / TECH3) as a string AddHQ = function (self, faction, layer, tech) self.HQs[faction][layer][tech] = self.HQs[faction][layer][tech] + 1 end, --- Removes an HQ so that the engi mod knows we lost it for the engi mod. - -- @param self The brain itself - -- @param faction The faction (AEON / UEF / SERAPHIM / CYBRAN / NOMADS) as a string - -- @param layer The layer (LAND / AIR / NAVY) as a string - -- @param tech The tech (TECH2 / TECH3) as a string + ---@param self AIBrain + ---@param faction HqFaction The faction (AEON / UEF / SERAPHIM / CYBRAN / NOMADS) as a string + ---@param layer HqLayer The layer (LAND / AIR / NAVY) as a string + ---@param tech HqTech The tech (TECH2 / TECH3) as a string RemoveHQ = function (self, faction, layer, tech) self.HQs[faction][layer][tech] = math.max(0, self.HQs[faction][layer][tech] - 1) end, --- Manages the support factory restrictions of the engi mod - -- @param self The brain itself + ---@param self AIBrain -- @param faction The faction (AEON / UEF / SERAPHIM / CYBRAN / NOMADS) as a string -- @param layer The layer (LAND / AIR / NAVY) as a string SetHQSupportFactoryRestrictions = function (self, faction, layer) @@ -189,7 +246,7 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Counts all HQs of specific faction, layer and tech for the engi mod. - -- @param self The brain itself + ---@param self AIBrain -- @param faction The faction (AEON / UEF / SERAPHIM / CYBRAN / NOMADS) as a string -- @param layer The layer (LAND / AIR / NAVY) as a string -- @param tech The tech (TECH2 / TECH3) as a string @@ -198,7 +255,7 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Counts all HQs of faction and tech, regardless of layer - -- @param self The brain itself + ---@param self AIBrain -- @param faction The faction (AEON / UEF / SERAPHIM / CYBRAN / NOMADS) as a string -- @param tech The tech (TECH2 / TECH3) as a string CountHQsAllLayers = function (self, faction, tech) @@ -208,6 +265,7 @@ AIBrain = Class(moho.aibrain_methods) { return count end, + ---@param self AIBrain CreateBrainShared = function(self, planName) -- make sure there is always some storage @@ -285,6 +343,7 @@ AIBrain = Class(moho.aibrain_methods) { self.VOTable = {} end, + ---@param self AIBrain OnSpawnPreBuiltUnits = function(self) local factionIndex = self:GetFactionIndex() local resourceStructures = nil @@ -331,8 +390,8 @@ AIBrain = Class(moho.aibrain_methods) { -- Energy storage callbacks --- Adds a unit that is enabled / disabled depending on how much energy storage we have. The unit starts enabled - -- @param self The brain itself - -- @param unit The unit to keep track of + ---@param self AIBrain The brain itself + ---@param unit MassFabricationUnit The unit to keep track of AddEnabledEnergyExcessUnit = function (self, unit) self.EnergyExcessUnitsEnabled[unit.EntityId] = unit self.EnergyExcessUnitsDisabled[unit.EntityId] = nil @@ -343,8 +402,8 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Adds a unit that is enabled / disabled depending on how much energy storage we have. The unit starts disabled - -- @param self The brain itself - -- @param unit The unit to keep track of + ---@param self AIBrain + ---@param unit MassFabricationUnit The unit to keep track of AddDisabledEnergyExcessUnit = function (self, unit) self.EnergyExcessUnitsEnabled[unit.EntityId] = nil self.EnergyExcessUnitsDisabled[unit.EntityId] = unit @@ -352,8 +411,8 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Removes a unit that is enabled / disabled depending on how much energy storage we have - -- @param self The brain itself - -- @param unit The unit to forget about + ---@param self AIBrain + ---@param unit MassFabricationUnit The unit to forget about RemoveEnergyExcessUnit = function (self, unit) local ecobp = unit.Blueprint.Economy if self.EnergyExcessUnitsEnabled[unit.EntityId] then @@ -367,9 +426,19 @@ AIBrain = Class(moho.aibrain_methods) { end, --- A continious thread that across the life span of the brain. Is the heart and sole of the enabling and disabling of units that are designed to eliminate excess energy. - -- @param self The brain itself + ---@param self AIBrain ToggleEnergyExcessUnitsThread = function (self) + -- allow for protected calls without closures + ---@param unitToProcess MassFabricationUnit + local function ProtectedOnExcessEnergy(unitToProcess) + unitToProcess:OnExcessEnergy() + end + + ---@param unitToProcess MassFabricationUnit + local function ProtectedOnNoExcessEnergy(unitToProcess) + unitToProcess:OnNoExcessEnergy() + end local fabricatorParameters = import('/lua/shared/FabricatorBehaviorParams.lua') local disableRatio = fabricatorParameters.DisableRatio local disableStorage = fabricatorParameters.DisableStorage @@ -473,13 +542,14 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Adds an entity to the list of entities that receive callbacks when the energy storage is depleted or viable, expects the functions OnEnergyDepleted and OnEnergyViable on the unit - -- @param self Brain that keeps track of the entity - -- @param entity Entity to be updated according to the + ---@param self AIBrain + ---@param entity Shield to be updated according to the AddEnergyDependingEntity = function(self, entity) self.EnergyDependingUnits[self.EnergyDependingUnitsHead] = entity self.EnergyDependingUnitsHead = self.EnergyDependingUnitsHead + 1 end, + ---@param self AIBrain OnEnergyTrigger = function(self, triggerName) if triggerName == "EnergyDepleted" then -- add trigger when we can recover units @@ -517,6 +587,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- TRIGGERS BASED ON AN AI BRAIN + ---@param self AIBrain OnStatsTrigger = function(self, triggerName) if triggerName == "EnergyDepleted" or triggerName == "EnergyViable" then @@ -537,6 +608,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain RemoveEconomyTrigger = function(self, triggerName) for k, v in self.TriggerList do if v.Name == triggerName then @@ -555,6 +627,8 @@ AIBrain = Class(moho.aibrain_methods) { -- OnceOnly: fire onceonly -- TargetAIBrain: AI Brain of the army you want it to trigger off of. -- }, + ---@param self AIBrain + ---@param triggerSpec unknown SetupArmyIntelTrigger = function(self, triggerSpec) table.insert(self.IntelTriggerList, triggerSpec) end, @@ -565,6 +639,7 @@ AIBrain = Class(moho.aibrain_methods) { -- type: 'LOSNow', 'Radar', 'Sonar', or 'Omni' -- val: true or false -- calls callback function with blip it saw. + ---@param self AIBrain OnIntelChange = function(self, blip, reconType, val) if self.IntelTriggerList then for k, v in self.IntelTriggerList do @@ -580,6 +655,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AddUnitBuiltPercentageCallback = function(self, callback, category, percent) if not callback or not category or not percent then error('*ERROR: Attempt to add UnitBuiltPercentageCallback but invalid data given', 2) @@ -587,6 +663,7 @@ AIBrain = Class(moho.aibrain_methods) { table.insert(self.UnitBuiltTriggerList, {Callback = callback, Category = category, Percent = percent}) end, + ---@param self AIBrain SetupBrainVeterancyTrigger = function(self, triggerSpec) if not triggerSpec.CallCount then triggerSpec.CallCount = 1 @@ -594,6 +671,7 @@ AIBrain = Class(moho.aibrain_methods) { table.insert(self.VeterancyTriggerList, triggerSpec) end, + ---@param self AIBrain OnBrainUnitVeterancyLevel = function(self, unit, level) for _, v in self.VeterancyTriggerList do if EntityCategoryContains(v.Category, unit) and level == v.Level and v.CallCount > 0 then @@ -603,12 +681,14 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AddPingCallback = function(self, callback, pingType) if callback and pingType then table.insert(self.PingCallbackList, {CallbackFunction = callback, PingType = pingType}) end end, + ---@param self AIBrain DoPingCallbacks = function(self, pingData) for _, v in self.PingCallbackList do v.CallbackFunction(self, pingData) @@ -616,6 +696,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- AI BRAIN FUNCTIONS HANDLED HERE + ---@param self AIBrain ImportScenarioArmyPlans = function(self, planName) if planName and planName ~= '' then return import(planName).AIPlansList @@ -624,6 +705,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain ForkThread = function(self, fn, ...) if fn then local thread = ForkThread(fn, self, unpack(arg)) @@ -634,6 +716,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain OnDestroy = function(self) if self.BuilderManagers then self.ConditionsMonitor:Destroy() @@ -652,12 +735,15 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain ReportScore = function(self) local kills = self:GetArmyStat('Enemies_Commanders_Destroyed', 0).Value local score = Points[self.Result] or 0 + kills table.insert(Sync.GameResult, {self:GetArmyIndex(), string.format("%s %i", self.Result or 'score', score)}) end, + ---@param self AIBrain + ---@param result AIResult SetResult = function(self, result) if self.Result then return end if not Points[result] then @@ -669,6 +755,7 @@ AIBrain = Class(moho.aibrain_methods) { self:ReportScore() end, + ---@param self AIBrain OnDefeat = function(self) self:SetResult("defeat") @@ -920,18 +1007,23 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain OnVictory = function(self) self:SetResult("victory") end, + ---@param self AIBrain OnDraw = function(self) self:SetResult("draw") end, + ---@param self AIBrain IsDefeated = function(self) return self.Result == "defeat" end, + ---@param self AIBrain + ---@param bestPlan string SetCurrentPlan = function(self, bestPlan) if not bestPlan then self.CurrentPlan = self.AIPlansList[self:GetFactionIndex()][1] @@ -943,6 +1035,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain SetConstantEvaluate = function(self, eval) if eval == true and self.ConstantEval == false then self.ConstantEval = eval @@ -951,6 +1044,7 @@ AIBrain = Class(moho.aibrain_methods) { self.ConstantEval = eval end, + ---@param self AIBrain InitialAIThread = function(self) -- delay the AI so it can't reclaim the start area before it's cleared from the ACU landing blast. WaitTicks(30) @@ -958,6 +1052,7 @@ AIBrain = Class(moho.aibrain_methods) { self.ExecuteThread = self:ForkThread(self.ExecuteAIThread) end, + ---@param self AIBrain EvaluateAIThread = function(self) local personality = self:GetPersonality() local factionIndex = self:GetFactionIndex() @@ -973,6 +1068,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain EvaluateAIPlanList = function(self) local factionIndex = self:GetFactionIndex() local bestPlan = nil @@ -995,6 +1091,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain ExecuteAIThread = function(self) local personality = self:GetPersonality() @@ -1007,6 +1104,8 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain + ---@param planName string EvaluatePlan = function(self, planName) local plan = import(planName) if plan then @@ -1017,18 +1116,22 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain ExecutePlan = function(self) self.CurrentPlanScript.ExecutePlan(self) end, + ---@param self AIBrain SetRepeatExecution = function(self, repeatEx) self.RepeatExecution = repeatEx end, + ---@param self AIBrain GetCurrentPlanScript = function(self) return self.CurrentPlanScript end, + ---@param self AIBrain IgnoreArmyUnitCap = function(self, val) self.IgnoreArmyCaps = val SetIgnoreArmyCap(self, val) @@ -1045,6 +1148,7 @@ AIBrain = Class(moho.aibrain_methods) { OnPlayCommanderUnderAttackVO = {timeout = 15, bank = 'Computer_Computer_Commanders_01314'}, }, + ---@param self AIBrain PlayVOSound = function(self, string, sound) if not self.VOTable then self.VOTable = {} end @@ -1082,6 +1186,7 @@ AIBrain = Class(moho.aibrain_methods) { end) end, + ---@param self AIBrain OnTransportFull = function(self) if not self.loadingTransport or self.loadingTransport.full then return end @@ -1100,29 +1205,36 @@ AIBrain = Class(moho.aibrain_methods) { self:PlayVOSound('OnTransportFull', Sound {Bank = 'XGG', Cue = cue}) end, + ---@param self AIBrain OnUnitCapLimitReached = function(self) end, + ---@param self AIBrain OnFailedUnitTransfer = function(self) self:PlayVOSound('OnFailedUnitTransfer') end, + ---@param self AIBrain OnPlayNoStagingPlatformsVO = function(self) self:PlayVOSound('OnPlayNoStagingPlatformsVO') end, + ---@param self AIBrain OnPlayBusyStagingPlatformsVO = function(self) self:PlayVOSound('OnPlayBusyStagingPlatformsVO') end, + ---@param self AIBrain OnPlayCommanderUnderAttackVO = function(self) self:PlayVOSound('OnPlayCommanderUnderAttackVO') end, + ---@param self AIBrain NuclearLaunchDetected = function(self, sound) self:PlayVOSound('NuclearLaunchDetected', sound) end, -- SKIRMISH AI HELPER SYSTEMS + ---@param self AIBrain InitializeSkirmishSystems = function(self) -- Make sure we don't do anything for the human player!!! if self.BrainType == 'Human' then @@ -1181,6 +1293,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AddInitialEnemyThreatSorian = function(self, amount, decay, threatType) local aiBrain = self local myArmy = ScenarioInfo.ArmySetup[self.Name] @@ -1205,6 +1318,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Removes bases that have no engineers or factories. This is a sorian AI function -- Helps reduce the load on the game. + ---@param self AIBrain DeadBaseMonitor = function(self) while true do WaitSeconds(5) @@ -1233,6 +1347,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- Used to get rid of nil table entries --sorian ai function + ---@param self AIBrain RebuildTable = function(self, oldtable) local temptable = {} for k, v in oldtable do @@ -1247,6 +1362,7 @@ AIBrain = Class(moho.aibrain_methods) { return temptable end, + ---@param self AIBrain GetLocationPosition = function(self, locationType) if not self.BuilderManagers[locationType] then WARN('*AI ERROR: Invalid location type - ' .. locationType) @@ -1255,6 +1371,7 @@ AIBrain = Class(moho.aibrain_methods) { return self.BuilderManagers[locationType].Position end, + ---@param self AIBrain FindClosestBuilderManagerPosition = function(self, position) local distance, closest for k, v in self.BuilderManagers do @@ -1277,6 +1394,7 @@ AIBrain = Class(moho.aibrain_methods) { return closest end, + ---@param self AIBrain ForceManagerSort = function(self) for _, v in self.BuilderManagers do v.EngineerManager:SortBuilderList('Any') @@ -1287,6 +1405,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain GetManagerCount = function(self, type) local count = 0 for k, v in self.BuilderManagers do @@ -1312,7 +1431,9 @@ AIBrain = Class(moho.aibrain_methods) { return count end, + ---@param self AIBrain BaseMonitorInitializationSorian = function(self, spec) + ---@class AiBaseMonitor self.BaseMonitor = { BaseMonitorStatus = 'ACTIVE', BaseMonitorPoints = {}, @@ -1352,6 +1473,7 @@ AIBrain = Class(moho.aibrain_methods) { PlatoonDistressThread = false, PlatoonAlertSounded = false, } + ---@class AiSelfMonitor self.SelfMonitor = { CheckRadius = spec.SelfCheckRadius or 150, ArtyCheckRadius = spec.SelfArtyCheckRadius or 300, @@ -1360,6 +1482,7 @@ AIBrain = Class(moho.aibrain_methods) { self:ForkThread(self.BaseMonitorThreadSorian) end, + ---@param self AIBrain BaseMonitorThreadSorian = function(self) while true do if self.BaseMonitor.BaseMonitorStatus == 'ACTIVE' then @@ -1370,6 +1493,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain SelfMonitorCheck = function(self) if not self.BaseMonitor.AlertSounded then local startlocx, startlocz = self:GetArmyStartPos() @@ -1426,6 +1550,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AddBuilderManagers = function(self, position, radius, baseName, useCenter) self.BuilderManagers[baseName] = { FactoryManager = FactoryManager.CreateFactoryBuilderManager(self, baseName, position, radius, useCenter), @@ -1439,6 +1564,7 @@ AIBrain = Class(moho.aibrain_methods) { self.NumBases = self.NumBases + 1 end, + ---@param self AIBrain GetEngineerManagerUnitsBeingBuilt = function(self, category) local unitCount = 0 for k, v in self.BuilderManagers do @@ -1447,6 +1573,7 @@ AIBrain = Class(moho.aibrain_methods) { return unitCount end, + ---@param self AIBrain GetFactoriesBeingBuilt = function(self) local unitCount = 0 @@ -1457,6 +1584,7 @@ AIBrain = Class(moho.aibrain_methods) { return unitCount end, + ---@param self AIBrain UnderEnergyThreshold = function(self) self:SetupOverEnergyStatTrigger(0.1) for k, v in self.BuilderManagers do @@ -1464,6 +1592,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain OverEnergyThreshold = function(self) self:SetupUnderEnergyStatTrigger(0.05) for k, v in self.BuilderManagers do @@ -1471,6 +1600,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain UnderMassThreshold = function(self) self:SetupOverMassStatTrigger(0.1) for k, v in self.BuilderManagers do @@ -1478,6 +1608,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain OverMassThreshold = function(self) self:SetupUnderMassStatTrigger(0.05) for k, v in self.BuilderManagers do @@ -1485,6 +1616,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain SetupUnderEnergyStatTrigger = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.UnderEnergyThreshold, self, 'SkirmishUnderEnergyThreshold', { @@ -1497,6 +1629,7 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain SetupOverEnergyStatTrigger = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.OverEnergyThreshold, self, 'SkirmishOverEnergyThreshold', { @@ -1509,6 +1642,7 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain SetupUnderMassStatTrigger = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.UnderMassThreshold, self, 'SkirmishUnderMassThreshold', { @@ -1521,6 +1655,7 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain SetupOverMassStatTrigger = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.OverMassThreshold, self, 'SkirmishOverMassThreshold', { @@ -1533,11 +1668,13 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain GetStartVector3f = function(self) local startX, startZ = self:GetArmyStartPos() return {startX, 0, startZ} end, + ---@param self AIBrain CalculateLayerPreference = function(self) local personality = self:GetPersonality() local factionIndex = self:GetFactionIndex() @@ -1565,12 +1702,14 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AIGetLayerPreference = function(self) return self.LayerPref end, -- ECONOMY MONITOR -- Monitors the economy over time for skirmish; allows better trend analysis + ---@param self AIBrain EconomyMonitor = function(self) -- build "eco trend over time" table for i = 1, self.EconomyTicksMonitor do @@ -1594,6 +1733,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain GetEconomyOverTime = function(self) local eIncome = 0 local mIncome = 0 @@ -1617,15 +1757,18 @@ AIBrain = Class(moho.aibrain_methods) { return retTable end, + ---@param self AIBrain InitializeAttackManager = function(self, attackDataTable) self.AttackManager = import('/lua/AI/attackmanager.lua').AttackManager(self, attackDataTable) self.AttackData = self.AttackManager end, + ---@param self AIBrain AMAddPlatoon = function(self, spec) self.AttackManager:AddPlatoon(spec) end, + ---@param self AIBrain AMPauseAttackManager = function(self) self.AttackManager:PauseAttackManager() end, @@ -1634,9 +1777,12 @@ AIBrain = Class(moho.aibrain_methods) { -- New PlatoonBuildManager -- This system is meant to be able to give some data about the platoon you want and have them -- built and formed into platoons at will. + ---@param self AIBrain InitializePlatoonBuildManager = function(self) if not self.PBM then + ---@class AiPlatoonBuildManager self.PBM = { + BuildCheckInterval = nil, Platoons = { Air = {}, Land = {}, @@ -1676,6 +1822,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMSetEnabled = function(self, enable) if not self.PBMThread and enable then self.PBMThread = self:ForkThread(self.PlatoonBuildManagerThread) @@ -1708,6 +1855,7 @@ AIBrain = Class(moho.aibrain_methods) { -- } -- } -- }, + ---@param self AIBrain PBMAddPlatoon = function(self, pltnTable) if not pltnTable.PlatoonTemplate then local stng = '*AI ERROR: INVALID PLATOON LIST IN '.. self.CurrentPlan.. ' - MISSING TEMPLATE. ' @@ -1775,6 +1923,7 @@ AIBrain = Class(moho.aibrain_methods) { self.HasPlatoonList = true end, + ---@param self AIBrain PBMRemoveBuilder = function(self, builderName) for pType, builders in self.PBM.Platoons do for num, data in builders do @@ -1790,6 +1939,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Function to clear all the platoon lists so you can feed it a bunch more. -- formPlatoons - Gives you the option to form all the platoons in the list before its cleaned up so that -- you don't have units hanging around. + ---@param self AIBrain PBMClearPlatoonList = function(self, formPlatoons) if formPlatoons then for _, v in self.PBM.PlatoonTypes do @@ -1809,6 +1959,7 @@ AIBrain = Class(moho.aibrain_methods) { } end, + ---@param self AIBrain PBMFormAllPlatoons = function(self, location) local locData = self:PBMGetLocation(location) if not locData then @@ -1819,10 +1970,12 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMHasPlatoonList = function(self) return self.HasPlatoonList end, + ---@param self AIBrain PBMResetPrimaryFactories = function(self) for _, v in self.PBM.Locations do v.PrimaryFactories.Air = nil @@ -1833,6 +1986,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- Goes through the location areas, finds the factories, sets a primary then tells all the others to guard. + ---@param self AIBrain PBMSetPrimaryFactories = function(self) for _, v in self.PBM.Locations do local factories = self:GetAvailableFactories(v.Location, v.Radius) @@ -1900,6 +2054,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMAssistGivenFactory = function(self, factories, primary) for _, v in factories do if not v.Dead and not (v:IsUnitState('Building') or v:IsUnitState('Upgrading')) then @@ -1912,6 +2067,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMSetRallyPoint = function(self, factories, location, rallyLoc, markerType) if not table.empty(factories) then local rally @@ -1954,6 +2110,7 @@ AIBrain = Class(moho.aibrain_methods) { return true end, + ---@param self AIBrain PBMFactoryLocationCheck = function(self, factory, location) -- If passed in a PBM Location table or location type name local locationName = location @@ -1993,6 +2150,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMCheckHighestTechFactory = function(self, factories, primary) local catTable = {categories.TECH1, categories.TECH2, categories.TECH3} local catLevel = 1 @@ -2015,6 +2173,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- Picks the first tech 3, tech 2 or tech 1 factory to make primary + ---@param self AIBrain PBMGetPrimaryFactory = function(self, factories) local categoryTable = {categories.TECH3, categories.TECH2, categories.TECH1} for kc, vc in categoryTable do @@ -2026,6 +2185,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMGetPriority = function(self, platoon) for typek, typev in self.PBM.PlatoonTypes do for k, v in self.PBM.Platoons[typev] do @@ -2040,6 +2200,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMAdjustPriority = function(self, platoon, amount) for typek, typev in self.PBM.PlatoonTypes do for k, v in self.PBM.Platoons[typev] do @@ -2063,6 +2224,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMSetPriority = function(self, platoon, amount) for typek, typev in self.PBM.PlatoonTypes do for k, v in self.PBM.Platoons[typev] do @@ -2087,6 +2249,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- Adds a new build location + ---@param self AIBrain PBMAddBuildLocation = function(self, loc, radius, locType, useCenterPoint) if not radius or not loc or not locType then error('*AI ERROR: INVALID BUILD LOCATION FOR PBM', 2) @@ -2121,6 +2284,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMGetLocation = function(self, locationName) if self.HasPlatoonList then for _, v in self.PBM.Locations do @@ -2132,6 +2296,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMGetLocationCoords = function(self, loc) if not loc then return false @@ -2152,6 +2317,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMGetLocationRadius = function(self, loc) if not loc then return false @@ -2168,6 +2334,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMGetLocationFactories = function(self, location) if not location then return false @@ -2180,6 +2347,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMGetAllFactories = function(self, location) if not location then return false @@ -2206,6 +2374,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Removes a build location based on it area -- IF either is nil, then it will do the other. -- This way you can remove all of one type or all of one rectangle + ---@param self AIBrain PBMRemoveBuildLocation = function(self, loc, locType) for k, v in self.PBM.Locations do if (loc and v.Location == loc) or (locType and v.LocationType == locType) then @@ -2216,6 +2385,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Sort platoon list -- PlatoonType = 'Air', 'Land' or 'Sea' + ---@param self AIBrain PBMSortPlatoonsViaPriority = function(self, platoonType) if platoonType ~= 'Air' and platoonType ~= 'Land' and platoonType ~= 'Sea' and platoonType ~= 'Gate' then local strng = '*AI ERROR: TRYING TO SORT PLATOONS VIA PRIORITY BUT AN INVALID TYPE (', repr(platoonType), ') WAS PASSED IN.' @@ -2241,18 +2411,22 @@ AIBrain = Class(moho.aibrain_methods) { self.PBM.NeedSort[platoonType] = false end, + ---@param self AIBrain PBMSetCheckInterval = function(self, interval) self.PBM.BuildCheckInterval = interval end, + ---@param self AIBrain PBMEnableRandomSamePriority = function(self) self.PBM.RandomSamePriority = true end, + ---@param self AIBrain PBMDisableRandomSamePriority = function(self) self.PBM.RandomSamePriority = false end, + ---@param self AIBrain PBMCheckBusyFactories = function(self) local busyPlat = self:GetPlatoonUniquelyNamed('BusyFactories') if not busyPlat then @@ -2281,11 +2455,13 @@ AIBrain = Class(moho.aibrain_methods) { self:AssignUnitsToPlatoon(busyPlat, poolTransfer, 'Unassigned', 'None') end, + ---@param self AIBrain PBMUnlockStartThread = function(self) WaitSeconds(1) ScenarioInfo.PBMStartLock = false end, + ---@param self AIBrain PBMUnlockStart = function(self) while ScenarioInfo.PBMStartLock do WaitTicks(1) @@ -2296,6 +2472,7 @@ AIBrain = Class(moho.aibrain_methods) { self:ForkThread(self.PBMUnlockStartThread) end, + ---@param self AIBrain PBMHandleAvailable = function(self, builderData) if not builderData.PlatoonHandles then return false @@ -2308,6 +2485,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMStoreHandle = function(self, platoon, builderData) if not builderData.PlatoonHandles then return false @@ -2329,6 +2507,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMRemoveHandle = function(self, platoon) for typek, typev in self.PBM.PlatoonTypes do for k, v in self.PBM.Platoons[typev] do @@ -2345,6 +2524,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMSetHandleBuilding = function(self, builder) if not builder.PlatoonHandles then error('*AI DEBUG: No PlatoonHandles for builder - ' .. builder.BuilderName) @@ -2361,6 +2541,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMCheckHandleBuilding = function(self, builder) if not builder.PlatoonHandles then error('*AI DEBUG: No PlatoonHandles for builder - ' .. builder.BuilderName) @@ -2374,6 +2555,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMSetBuildingHandleFalse = function(self, builder) if not builder.PlatoonHandles then error('*AI DEBUG: No PlatoonHandles for builder - ' .. builder.BuilderName) @@ -2388,6 +2570,7 @@ AIBrain = Class(moho.aibrain_methods) { return false end, + ---@param self AIBrain PBMNumHandlesAvailable = function(self, builder) local numAvail = 0 for k, v in builder.PlatoonHandles do @@ -2399,6 +2582,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- Main building and forming platoon thread for the Platoon Build Manager + ---@param self AIBrain PlatoonBuildManagerThread = function(self) local personality = self:GetPersonality() local armyIndex = self:GetArmyIndex() @@ -2522,6 +2706,7 @@ AIBrain = Class(moho.aibrain_methods) { -- requireBuilding: true = platoon must have 'BUILDING' has its handle, false = it'll form any platoon it can -- Platoontype is just 'Air'/'Land'/'Sea', those are found in the platoon build manager table template. -- Location/Radius are where to do this. If they aren't specified they will grab from anywhere. + ---@param self AIBrain PBMFormPlatoons = function(self, requireBuilding, platoonType, location) local platoonList = self.PBM.Platoons local personality = self:GetPersonality() @@ -2658,6 +2843,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Get the primary factory with the lowest order count -- This is used for the 'Any' platoon type so we can find any primary factory to build from. + ---@param self AIBrain GetLowestOrderPrimaryFactory = function(self, location) local num local fac @@ -2675,6 +2861,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- Set number of units to be built as the number of factories in a location + ---@param self AIBrain PBMBuildNumFactories = function (self, template, location, pType, factory) local retTemplate = table.deepcopy(template) local assistFacs = factory[1]:GetGuards() @@ -2752,6 +2939,7 @@ AIBrain = Class(moho.aibrain_methods) { return retTemplate end, + ---@param self AIBrain PBMGenerateTimeOut = function(self, platoon, factories, location, pType) local retBuildTime = 0 local i = 3 @@ -2785,6 +2973,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMGetNumFactoriesAtLocation = function(self, location, pType) local airFactories = {} local landFactories = {} @@ -2818,6 +3007,7 @@ AIBrain = Class(moho.aibrain_methods) { return numFactories end, + ---@param self AIBrain PBMPlatoonTimeOutThread = function(self, platoon) local minWait = 5 -- 240 CAMPAIGNS if platoon.BuildTimeOut and platoon.BuildTimeOut < minWait then @@ -2828,6 +3018,7 @@ AIBrain = Class(moho.aibrain_methods) { self:PBMSetBuildingHandleFalse(platoon) end, + ---@param self AIBrain PBMFactoryCanBuildPlatoon = function(self, platoonTemplate, factory) for i = 3, table.getn(platoonTemplate) do if not factory:CanBuild(platoonTemplate[i][1]) then @@ -2837,6 +3028,7 @@ AIBrain = Class(moho.aibrain_methods) { return true end, + ---@param self AIBrain PBMPlatoonDestroyed = function(self, platoon) self:PBMRemoveHandle(platoon) if platoon.PlatoonData.BuilderName then @@ -2844,6 +3036,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PBMCheckBuildConditions = function(self, bCs, index) for _, v in bCs do if not v.LookupNumber[index] then @@ -2904,12 +3097,14 @@ AIBrain = Class(moho.aibrain_methods) { return true end, + ---@param self AIBrain PBMClearBuildConditionsCache = function(self) for k, v in self.PBM.BuildConditionsTable do v.Cached[self:GetArmyIndex()] = false end end, + ---@param self AIBrain CombinePlatoons = function(self, platoonList, ai) local squadTypes = {'Unassigned', 'Attack', 'Artillery', 'Support', 'Scout', 'Guard'} local returnPlatoon @@ -2933,7 +3128,9 @@ AIBrain = Class(moho.aibrain_methods) { end, -- BASE MONITORING SYSTEM + ---@param self AIBrain BaseMonitorInitialization = function(self, spec) + ---@class AiBaseMonitor self.BaseMonitor = { BaseMonitorStatus = 'ACTIVE', BaseMonitorPoints = {}, @@ -2972,6 +3169,7 @@ AIBrain = Class(moho.aibrain_methods) { self:ForkThread(self.BaseMonitorThread) end, + ---@param self AIBrain BaseMonitorPlatoonDistress = function(self, platoon, threat) if not self.BaseMonitor then return @@ -2995,6 +3193,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain BaseMonitorPlatoonDistressThread = function(self) self.BaseMonitor.PlatoonAlertSounded = true while true do @@ -3027,6 +3226,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain BaseMonitorDistressLocation = function(self, position, radius, threshold) local returnPos = false local highThreat = false @@ -3098,6 +3298,7 @@ AIBrain = Class(moho.aibrain_methods) { return returnPos end, + ---@param self AIBrain BaseMonitorThread = function(self) while true do if self.BaseMonitor.BaseMonitorStatus == 'ACTIVE' then @@ -3107,6 +3308,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain BaseMonitorAlertTimeout = function(self, pos, threattype) local timeout = self.BaseMonitor.DefaultAlertTimeout local threat @@ -3144,6 +3346,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain BaseMonitorCheck = function(self) local vecs = self:GetStructureVectors() if not table.empty(vecs) then @@ -3203,6 +3406,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain ParseIntelThreadSorian = function(self) if not self.InterestList or not self.InterestList.MustScout then error('Scouting areas must be initialized before calling AIBrain:ParseIntelThread.', 2) @@ -3330,6 +3534,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain T4ThreatMonitorTimeout = function(self, threattypes) WaitSeconds(180) for _, v in threattypes do @@ -3337,6 +3542,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain GetBaseVectors = function(self) local enemy = self:GetCurrentEnemy() local index = self:GetArmyIndex() @@ -3367,6 +3573,7 @@ AIBrain = Class(moho.aibrain_methods) { return returnPoints end, + ---@param self AIBrain GetStructureVectors = function(self) local structures = self:GetListOfUnits(categories.STRUCTURE - categories.WALL, false) -- Add all points around location @@ -3392,6 +3599,7 @@ AIBrain = Class(moho.aibrain_methods) { end, -- ENEMY PICKER AI + ---@param self AIBrain PickEnemy = function(self) while true do self:PickEnemyLogic() @@ -3399,6 +3607,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain GetAllianceEnemy = function(self, strengthTable) local returnEnemy = false @@ -3425,6 +3634,7 @@ AIBrain = Class(moho.aibrain_methods) { return returnEnemy end, + ---@param self AIBrain PickEnemyLogic = function(self) local armyStrengthTable = {} local selfIndex = self:GetArmyIndex() @@ -3498,12 +3708,14 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain GetNewAttackVectors = function(self) if not self.AttackVectorsThread then self.AttackVectorsThread = self:ForkThread(self.SetupAttackVectorsThread) end end, + ---@param self AIBrain SetupAttackVectorsThread = function(self) self.AttackVectorUpdate = 0 while true do @@ -3517,10 +3729,12 @@ AIBrain = Class(moho.aibrain_methods) { end, -- Skirmish expansion help + ---@param self AIBrain ExpansionHelp = function(self, eng, reference) self:ForkThread(self.ExpansionHelpThread, eng, reference) end, + ---@param self AIBrain ExpansionHelpThread = function(self, eng, reference) local pool = self:GetPlatoonUniquelyNamed('ArmyPool') local landHelp = {} @@ -3538,6 +3752,7 @@ AIBrain = Class(moho.aibrain_methods) { self:ForkThread(self.GroupHelpThread, landHelp, reference) end, + ---@param self AIBrain GroupHelpThread = function(self, units, reference) local plat = self:MakePlatoon('', '') self:AssignUnitsToPlatoon(plat, units, 'Attack', 'GrowthFormation') @@ -3554,6 +3769,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AbandonedByPlayer = function(self) if not IsGameOver() then if ScenarioInfo.Options.AIReplacement == 'On' then @@ -3604,6 +3820,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Creates an influence map threat at enemy bases so the AI will start sending attacks before scouting gets up. -- Returns: -- nil + ---@param self AIBrain AddInitialEnemyThreat = function(self, amount, decay) local aiBrain = self local myArmy = ScenarioInfo.ArmySetup[self.Name] @@ -3635,6 +3852,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Returns: -- nil (loops forever) ------------------------------------------------------- + ---@param self AIBrain ParseIntelThread = function(self) if not self.InterestList or not self.InterestList.MustScout then error('Scouting areas must be initialized before calling AIBrain:ParseIntelThread.', 2) @@ -3699,6 +3917,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Returns: -- location, index ------------------------------------------------------- + ---@param self AIBrain GetUntaggedMustScoutArea = function(self) -- If any locations have been specifically tagged for scouting if not self.InterestList or not self.InterestList.MustScout then @@ -3722,6 +3941,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Returns: -- nil ------------------------------------------------------- + ---@param self AIBrain AddScoutArea = function(self, location) if not self.InterestList or not self.InterestList.MustScout then error('Scouting areas must be initialized before calling AIBrain:AddScoutArea.', 2) @@ -3753,6 +3973,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Returns: -- nil ------------------------------------------------------- + ---@param self AIBrain BuildScoutLocations = function(self) local aiBrain = self local opponentStarts = {} @@ -3880,6 +4101,7 @@ AIBrain = Class(moho.aibrain_methods) { -- Returns: -- nil ------------------------------------------------------- + ---@param self AIBrain SortScoutingAreas = function(self, list) table.sort(list, function(a, b) if a.LastScouted == b.LastScouted then @@ -3894,6 +4116,7 @@ AIBrain = Class(moho.aibrain_methods) { end) end, + ---@param self AIBrain BuildScoutLocationsSorian = function(self) local aiBrain = self local opponentStarts = {} @@ -4020,6 +4243,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PickEnemySorian = function(self) self.targetoveride = false while true do @@ -4028,6 +4252,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain PickEnemyLogicSorian = function(self, brainbool) local armyStrengthTable = {} local selfIndex = self:GetArmyIndex() @@ -4104,26 +4329,31 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain UnderEnergyThresholdSorian = function(self) self:SetupOverEnergyStatTriggerSorian(0.15) self.LowEnergyMode = true end, + ---@param self AIBrain OverEnergyThresholdSorian = function(self) self:SetupUnderEnergyStatTriggerSorian(0.1) self.LowEnergyMode = false end, + ---@param self AIBrain UnderMassThresholdSorian = function(self) self:SetupOverMassStatTriggerSorian(0.15) self.LowMassMode = true end, + ---@param self AIBrain OverMassThresholdSorian = function(self) self:SetupUnderMassStatTriggerSorian(0.1) self.LowMassMode = false end, + ---@param self AIBrain SetupUnderEnergyStatTriggerSorian = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.UnderEnergyThresholdSorian, self, 'SkirmishUnderEnergyThresholdSorian', { @@ -4136,6 +4366,7 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain SetupOverEnergyStatTriggerSorian = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.OverEnergyThresholdSorian, self, 'SkirmishOverEnergyThresholdSorian', { @@ -4148,6 +4379,7 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain SetupUnderMassStatTriggerSorian = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.UnderMassThresholdSorian, self, 'SkirmishUnderMassThresholdSorian', { @@ -4160,6 +4392,7 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain SetupOverMassStatTriggerSorian = function(self, threshold) import('/lua/scenariotriggers.lua').CreateArmyStatTrigger(self.OverMassThresholdSorian, self, 'SkirmishOverMassThresholdSorian', { @@ -4172,6 +4405,7 @@ AIBrain = Class(moho.aibrain_methods) { ) end, + ---@param self AIBrain DoAIPing = function(self, pingData) if self.Sorian then if pingData.Type then @@ -4180,6 +4414,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AttackPointsTimeout = function(self, pos) WaitSeconds(300) for k, v in self.AttackPoints do @@ -4190,6 +4425,7 @@ AIBrain = Class(moho.aibrain_methods) { end end, + ---@param self AIBrain AirAttackPointsTimeout = function(self, pos, enemy) local threat local myThreat @@ -4214,6 +4450,7 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Retrieves all units that fit the criteria around some point. Excludes dummy units. + ---@param self AIBrain -- @param category The categories the units should fit. -- @param position The center point to start looking for units. -- @param radius The radius of the circle we look for units in. @@ -4230,6 +4467,7 @@ AIBrain = Class(moho.aibrain_methods) { end, --- Returns list of units by category. Excludes dummy units. + ---@param self AIBrain -- @param category Unit's category, example: categories.TECH2 . -- @param needToBeIdle true/false Unit has to be idle (appears to be not functional). -- @param requireBuilt true/false defaults to false which excludes units that are NOT finished (appears to be not functional). diff --git a/lua/cybranprojectiles.lua b/lua/cybranprojectiles.lua index 9fc9537c0f..77d62a10ae 100644 --- a/lua/cybranprojectiles.lua +++ b/lua/cybranprojectiles.lua @@ -29,6 +29,7 @@ local DefaultExplosion = import('defaultexplosions.lua') -------------------------------------------------------------------------- -- CYBRAN BRACKMAN "HACK PEG-POD" PROJECTILE -------------------------------------------------------------------------- +---@class CDFBrackmanHackPegProjectile01 : MultiPolyTrailProjectile CDFBrackmanHackPegProjectile01 = Class(MultiPolyTrailProjectile) { FxImpactTrajectoryAligned = false, PolyTrails = EffectTemplate.CBrackmanCrabPegPodTrails, @@ -45,6 +46,7 @@ CDFBrackmanHackPegProjectile01 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN BRACKMAN "HACK PEG" PROJECTILES -------------------------------------------------------------------------- +---@class CDFBrackmanHackPegProjectile02 : MultiPolyTrailProjectile CDFBrackmanHackPegProjectile02 = Class(MultiPolyTrailProjectile) { FxImpactTrajectoryAligned = false, PolyTrails = EffectTemplate.CBrackmanCrabPegTrails, @@ -61,6 +63,7 @@ CDFBrackmanHackPegProjectile02 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN PROTON PROJECTILES -------------------------------------------------------------------------- +---@class CIFProtonBombProjectile : NullShell CIFProtonBombProjectile = Class(NullShell) { -- T3 strategic bomber FxImpactTrajectoryAligned = false, FxImpactUnit = EffectTemplate.CProtonBombHit01, @@ -91,6 +94,7 @@ CIFProtonBombProjectile = Class(NullShell) { -- T3 strategic bomber -------------------------------------------------------------------------- -- CYBRAN PROTON PROJECTILES -------------------------------------------------------------------------- +---@class CDFProtonCannonProjectile : MultiPolyTrailProjectile CDFProtonCannonProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = { EffectTemplate.CProtonCannonPolyTrail, @@ -108,6 +112,7 @@ CDFProtonCannonProjectile = Class(MultiPolyTrailProjectile) { } ---- XRL0403 experimental crab heavy proton cannon +---@class CDFHvyProtonCannonProjectile : MultiPolyTrailProjectile CDFHvyProtonCannonProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = { EffectTemplate.CHvyProtonCannonPolyTrail, @@ -128,6 +133,7 @@ CDFHvyProtonCannonProjectile = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN DISSIDENT PROJECTILE -------------------------------------------------------------------------- +---@class CAADissidentProjectile : SinglePolyTrailProjectile CAADissidentProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/electron_bolter_trail_01_emit.bp', @@ -143,6 +149,7 @@ CAADissidentProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- ELECTRON BURST CLOUD PROJECILE -------------------------------------------------------------------------- +---@class CAAElectronBurstCloudProjectile : SinglePolyTrailProjectile CAAElectronBurstCloudProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/default_polytrail_02_emit.bp', @@ -158,6 +165,7 @@ CAAElectronBurstCloudProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- NANITE MISSILE PROJECTILE -------------------------------------------------------------------------- +---@class CAAMissileNaniteProjectile : SingleCompositeEmitterProjectile CAAMissileNaniteProjectile = Class(SingleCompositeEmitterProjectile) { -- Emitter Values FxTrails = {}, @@ -176,6 +184,7 @@ CAAMissileNaniteProjectile = Class(SingleCompositeEmitterProjectile) { FxImpactUnderWater = {}, } +---@class CAAMissileNaniteProjectile03 : CAAMissileNaniteProjectile CAAMissileNaniteProjectile03 = Class(CAAMissileNaniteProjectile) { -- PolyTrail = '/effects/emitters/caamissilenanite01_polytrail_02_emit.bp', } @@ -183,6 +192,7 @@ CAAMissileNaniteProjectile03 = Class(CAAMissileNaniteProjectile) { -------------------------------------------------------------------------- -- NANODART PROJECILE -------------------------------------------------------------------------- +---@class CAANanoDartProjectile : SinglePolyTrailProjectile CAANanoDartProjectile = Class(SinglePolyTrailProjectile) { FxImpactTrajectoryAligned = false, @@ -196,11 +206,13 @@ CAANanoDartProjectile = Class(SinglePolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class CAANanoDartProjectile02 : CAANanoDartProjectile CAANanoDartProjectile02 = Class(CAANanoDartProjectile) { PolyTrail= EffectTemplate.CNanoDartPolyTrail02, } -- adjustment to cheapen effects for URL0104 +---@class CAANanoDartProjectile03 : CAANanoDartProjectile CAANanoDartProjectile03 = Class(CAANanoDartProjectile) { FxImpactAirUnit = EffectTemplate.CNanoDartUnitHit02, FxImpactUnit = EffectTemplate.CNanoDartUnitHit02, @@ -210,6 +222,7 @@ CAANanoDartProjectile03 = Class(CAANanoDartProjectile) { -------------------------------------------------------------------------- -- CYBRAN ARTILLERY PROJECILES -------------------------------------------------------------------------- +---@class CArtilleryProjectile : EmitterProjectile CArtilleryProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/mortar_munition_03_emit.bp',}, @@ -220,6 +233,7 @@ CArtilleryProjectile = Class(EmitterProjectile) { FxImpactUnderWater = {}, } +---@class CArtilleryProtonProjectile : SinglePolyTrailProjectile CArtilleryProtonProjectile = Class(SinglePolyTrailProjectile) { FxTrails = {}, FxImpactTrajectoryAligned = false, @@ -243,6 +257,7 @@ CArtilleryProtonProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN BEAM PROJECILES -------------------------------------------------------------------------- +---@class CBeamProjectile : NullShell CBeamProjectile = Class(NullShell) { FxUnitHitScale = 0.5, FxImpactUnit = EffectTemplate.CBeamHitUnit01, @@ -254,6 +269,7 @@ CBeamProjectile = Class(NullShell) { -------------------------------------------------------------------------- -- CYBRAN BOMBs -------------------------------------------------------------------------- +---@class CBombProjectile : EmitterProjectile CBombProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/bomb_munition_plasma_aeon_01_emit.bp'}, @@ -267,6 +283,7 @@ CBombProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- CYBRAN SHIP PROJECILES -------------------------------------------------------------------------- +---@class CCannonSeaProjectile : SingleBeamProjectile CCannonSeaProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/cannon_munition_ship_cybran_beam_01_emit.bp', FxImpactUnderWater = {}, @@ -275,6 +292,7 @@ CCannonSeaProjectile = Class(SingleBeamProjectile) { --------------------------------------------------------------------- -- CYBRAN TANK CANNON PROJECILES -------------------------------------------------------------------------- +---@class CCannonTankProjectile : SingleBeamProjectile CCannonTankProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/cannon_munition_ship_cybran_beam_01_emit.bp', FxImpactUnderWater = {}, @@ -283,6 +301,7 @@ CCannonTankProjectile = Class(SingleBeamProjectile) { ----------------------------- -- CYBRAN TRACKER PROJECILES ----------------------------- +---@class CDFTrackerProjectile : SingleCompositeEmitterProjectile CDFTrackerProjectile = Class(SingleCompositeEmitterProjectile) { -- Emitter Values FxInitial = {}, @@ -303,6 +322,7 @@ CDFTrackerProjectile = Class(SingleCompositeEmitterProjectile) { -------------------------------------------------------------------------- -- DISINTEGRATOR LASER PROJECILE -------------------------------------------------------------------------- +---@class CDisintegratorLaserProjectile : MultiPolyTrailProjectile CDisintegratorLaserProjectile = Class(MultiPolyTrailProjectile) { --loya & wailers PolyTrails = { '/effects/emitters/disintegrator_polytrail_04_emit.bp', @@ -321,6 +341,7 @@ CDisintegratorLaserProjectile = Class(MultiPolyTrailProjectile) { --loya & waile } -- adjusments for URA0104 to tone down effect +---@class CDisintegratorLaserProjectile02 : MultiPolyTrailProjectile CDisintegratorLaserProjectile02 = Class(MultiPolyTrailProjectile) { PolyTrails = { '/effects/emitters/disintegrator_polytrail_04_emit.bp', @@ -340,6 +361,7 @@ CDisintegratorLaserProjectile02 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN ELECTRON BOLTER PROJECILES -------------------------------------------------------------------------- +---@class CElectronBolterProjectile : MultiPolyTrailProjectile CElectronBolterProjectile = Class(MultiPolyTrailProjectile) { -- loya, wagner, monkeylord & soul ripper PolyTrails = { @@ -355,6 +377,7 @@ CElectronBolterProjectile = Class(MultiPolyTrailProjectile) { -- loya, wagner, m FxImpactLand = EffectTemplate.CElectronBolterHitLand01, } +---@class CHeavyElectronBolterProjectile : MultiPolyTrailProjectile CHeavyElectronBolterProjectile = Class(MultiPolyTrailProjectile) { -- SR PolyTrails = { @@ -408,6 +431,7 @@ CEMPFluxWarheadProjectile = Class(NukeProjectile, SingleBeamProjectile) { -------------------------------------------------------------------------- -- CYBRAN FLAME THROWER PROJECTILES -------------------------------------------------------------------------- +---@class CFlameThrowerProjectile : EmitterProjectile CFlameThrowerProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/flamethrower_02_emit.bp'}, FxTrailScale = 1, @@ -418,6 +442,7 @@ CFlameThrowerProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- CYBRAN MOLECULAR RESONANCE SHELL PROJECTILE -------------------------------------------------------------------------- +---@class CIFMolecularResonanceShell : SinglePolyTrailProjectile CIFMolecularResonanceShell = Class(SinglePolyTrailProjectile) { PolyTrail = '/effects/emitters/default_polytrail_01_emit.bp', @@ -457,6 +482,7 @@ CIFMolecularResonanceShell = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- IRIDIUM ROCKET PROJECTILES -------------------------------------------------------------------------- +---@class CIridiumRocketProjectile : SingleCompositeEmitterProjectile CIridiumRocketProjectile = Class(SingleCompositeEmitterProjectile) { -- T2 gs & SR & hoplite FxTrails = {}, PolyTrail = '/effects/emitters/cybran_iridium_missile_polytrail_01_emit.bp', @@ -470,6 +496,7 @@ CIridiumRocketProjectile = Class(SingleCompositeEmitterProjectile) { -- T2 gs & -------------------------------------------------------------------------- -- CORSAIR MISSILE PROJECTILES -------------------------------------------------------------------------- +---@class CCorsairRocketProjectile : SingleCompositeEmitterProjectile CCorsairRocketProjectile = Class(SingleCompositeEmitterProjectile) { FxTrails = {}, PolyTrail = EffectTemplate.CCorsairMissilePolyTrail01, @@ -483,6 +510,7 @@ CCorsairRocketProjectile = Class(SingleCompositeEmitterProjectile) { -------------------------------------------------------------------------- -- CYBRAN LASER PROJECILES -------------------------------------------------------------------------- +---@class CLaserLaserProjectile : MultiPolyTrailProjectile CLaserLaserProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = { '/effects/emitters/cybran_laser_trail_01_emit.bp', @@ -497,6 +525,7 @@ CLaserLaserProjectile = Class(MultiPolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class CHeavyLaserProjectile : MultiPolyTrailProjectile CHeavyLaserProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = { '/effects/emitters/cybran_laser_trail_02_emit.bp', @@ -511,6 +540,7 @@ CHeavyLaserProjectile = Class(MultiPolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class CHeavyLaserProjectile2 : MultiPolyTrailProjectile CHeavyLaserProjectile2 = Class(MultiPolyTrailProjectile) { PolyTrails = { '/effects/emitters/hrailgunsd_polytrail_01_emit.bp', @@ -530,6 +560,7 @@ CHeavyLaserProjectile2 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN MOLECULAR CANNON PROJECTILE -------------------------------------------------------------------------- +---@class CMolecularCannonProjectile : SinglePolyTrailProjectile CMolecularCannonProjectile = Class(SinglePolyTrailProjectile) { -- ACU FxImpactTrajectoryAligned = false, PolyTrail = '/effects/emitters/default_polytrail_03_emit.bp', @@ -544,6 +575,7 @@ CMolecularCannonProjectile = Class(SinglePolyTrailProjectile) { -- ACU -------------------------------------------------------------------------- -- CYBRAN AA MISSILE PROJECILES - Air Targets -------------------------------------------------------------------------- +---@class CMissileAAProjectile : SingleCompositeEmitterProjectile CMissileAAProjectile = Class(SingleCompositeEmitterProjectile) { -- Emitter Values FxInitial = {}, @@ -570,6 +602,7 @@ CMissileAAProjectile = Class(SingleCompositeEmitterProjectile) { -------------------------------------------------------------------------- -- NEUTRON CLUSTER BOMB PROJECTILES -------------------------------------------------------------------------- +---@class CNeutronClusterBombChildProjectile : SinglePolyTrailProjectile CNeutronClusterBombChildProjectile = Class(SinglePolyTrailProjectile) { FxTrails = {}, PolyTrail = '/effects/emitters/default_polytrail_05_emit.bp', @@ -586,6 +619,7 @@ CNeutronClusterBombChildProjectile = Class(SinglePolyTrailProjectile) { end, } +---@class CNeutronClusterBombProjectile : SinglePolyTrailProjectile CNeutronClusterBombProjectile = Class(SinglePolyTrailProjectile) { FxTrails = {}, PolyTrail = '/effects/emitters/default_polytrail_03_emit.bp', @@ -635,6 +669,7 @@ CNeutronClusterBombProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN MACHINE GUN SHELLS -------------------------------------------------------------------------- +---@class CParticleCannonProjectile : SingleBeamProjectile CParticleCannonProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/laserturret_munition_beam_01_emit.bp', @@ -648,6 +683,7 @@ CParticleCannonProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- CYBRAN RAIL GUN PROJECTILES -------------------------------------------------------------------------- +---@class CRailGunProjectile : EmitterProjectile CRailGunProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/railgun_munition_trail_02_emit.bp', '/effects/emitters/railgun_munition_trail_01_emit.bp'}, @@ -659,6 +695,7 @@ CRailGunProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- CYBRAN ROCKET PROJECILES -------------------------------------------------------------------------- +---@class CRocketProjectile : SingleBeamProjectile CRocketProjectile = Class(SingleBeamProjectile) { -- wagner -- Emitter Values BeamName = '/effects/emitters/rocket_iridium_exhaust_beam_01_emit.bp', @@ -670,6 +707,7 @@ CRocketProjectile = Class(SingleBeamProjectile) { -- wagner FxImpactUnderWater = {}, } +---@class CLOATacticalMissileProjectile : SingleBeamProjectile CLOATacticalMissileProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/missile_loa_munition_exhaust_beam_01_emit.bp', @@ -685,6 +723,7 @@ CLOATacticalMissileProjectile = Class(SingleBeamProjectile) { FxImpactUnderWater = {}, } +---@class CLOATacticalChildMissileProjectile : SingleBeamProjectile CLOATacticalChildMissileProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/missile_loa_munition_exhaust_beam_02_emit.bp', FxTrails = {'/effects/emitters/missile_cruise_munition_trail_03_emit.bp',}, @@ -731,6 +770,7 @@ CLOATacticalChildMissileProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- CYBRAN AUTOCANNON PROJECILES -------------------------------------------------------------------------- +---@class CShellAAAutoCannonProjectile : MultiPolyTrailProjectile CShellAAAutoCannonProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = { '/effects/emitters/auto_cannon_trail_01_emit.bp', @@ -750,6 +790,7 @@ CShellAAAutoCannonProjectile = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- CYBRAN RIOT PROJECILES -------------------------------------------------------------------------- +---@class CShellRiotProjectile : SingleBeamProjectile CShellRiotProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/riotgun_munition_beam_01_emit.bp', @@ -764,6 +805,7 @@ CShellRiotProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- CYBRAN ABOVE WATER LAUNCHED TORPEDO -------------------------------------------------------------------------- +---@class CTorpedoShipProjectile : OnWaterEntryEmitterProjectile CTorpedoShipProjectile = Class(OnWaterEntryEmitterProjectile) { FxSplashScale = 0.5, FxTrails = {'/effects/emitters/torpedo_munition_trail_01_emit.bp',}, @@ -800,6 +842,7 @@ CTorpedoShipProjectile = Class(OnWaterEntryEmitterProjectile) { -------------------------------------------------------------------------- -- CYBRAN SUB LAUNCHED TORPEDO -------------------------------------------------------------------------- +---@class CTorpedoSubProjectile : EmitterProjectile CTorpedoSubProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/torpedo_underwater_wake_02_emit.bp',}, @@ -821,6 +864,7 @@ CTorpedoSubProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- Cybran DEPTH CHARGE PROJECTILES -------------------------------------------------------------------------- +---@class CDepthChargeProjectile : OnWaterEntryEmitterProjectile CDepthChargeProjectile = Class(OnWaterEntryEmitterProjectile) { FxInitial = {}, FxTrails = { @@ -877,6 +921,7 @@ CDepthChargeProjectile = Class(OnWaterEntryEmitterProjectile) { -- -------------------------------------------------------------------------- +---@class CHeavyDisintegratorPulseLaser : MultiPolyTrailProjectile CHeavyDisintegratorPulseLaser = Class(MultiPolyTrailProjectile) { -- Brick PolyTrails = { '/effects/emitters/disintegrator_polytrail_02_emit.bp', @@ -895,5 +940,6 @@ CHeavyDisintegratorPulseLaser = Class(MultiPolyTrailProjectile) { -- Brick } +---@class CKrilTorpedo : OnWaterEntryEmitterProjectile CKrilTorpedo = Class(OnWaterEntryEmitterProjectile) { } diff --git a/lua/cybranunits.lua b/lua/cybranunits.lua index a1774f9871..d73f9e059e 100644 --- a/lua/cybranunits.lua +++ b/lua/cybranunits.lua @@ -63,6 +63,7 @@ local TrashBag = _G.TrashBag local TrashBagAdd = TrashBag.Add --- A class to managing the build bots. Make sure to call all the relevant functions. +---@class CConstructionTemplate : CConstructionTemplate = Class() { --- Prepares the values required to support bots @@ -260,6 +261,7 @@ CConstructionTemplate = Class() { --- The build bot class for drones. It removes a lot of -- the basic functionality of a unit to save on performance. +---@class CBuildBotUnit : DummyUnit CBuildBotUnit = Class(DummyUnit) { -- Keep track of the builder that made the bot @@ -323,6 +325,7 @@ CBuildBotUnit = Class(DummyUnit) { } -- AIR FACTORY STRUCTURES +---@class CAirFactoryUnit : AirFactoryUnit CAirFactoryUnit = Class(AirFactoryUnit) { CreateBuildEffects = function(self, unitBeingBuilt, order) if not unitBeingBuilt then return end @@ -362,12 +365,15 @@ CAirFactoryUnit = Class(AirFactoryUnit) { } -- AIR STAGING STRUCTURES +---@class CAirStagingPlatformUnit : AirStagingPlatformUnit CAirStagingPlatformUnit = Class(AirStagingPlatformUnit) {} -- AIR UNITS +---@class CAirUnit : AirUnit CAirUnit = Class(AirUnit) {} -- WALL STRUCTURES +---@class CConcreteStructureUnit : ConcreteStructureUnit CConcreteStructureUnit = Class(ConcreteStructureUnit) {} -- CONSTRUCTION UNITS @@ -455,9 +461,11 @@ CEnergyCreationUnit = Class(DefaultUnitsFile.EnergyCreationUnit) { } -- ENERGY STORAGE STRUCTURES +---@class CEnergyStorageUnit : EnergyStorageUnit CEnergyStorageUnit = Class(EnergyStorageUnit) {} -- LAND FACTORY STRUCTURES +---@class CLandFactoryUnit : LandFactoryUnit CLandFactoryUnit = Class(LandFactoryUnit) { CreateBuildEffects = function(self, unitBeingBuilt, order) if not unitBeingBuilt then return end @@ -518,6 +526,7 @@ CRadarUnit = Class(DefaultUnitsFile.RadarUnit) {} CSonarUnit = Class(DefaultUnitsFile.SonarUnit) {} -- SEA FACTORY STRUCTURES +---@class CSeaFactoryUnit : SeaFactoryUnit CSeaFactoryUnit = Class(SeaFactoryUnit) { StartBuildingEffects = function(self, unitBeingBuilt) @@ -580,15 +589,19 @@ CSeaFactoryUnit = Class(SeaFactoryUnit) { } -- SEA UNITS +---@class CSeaUnit : SeaUnit CSeaUnit = Class(SeaUnit) {} -- SHIELD LAND UNITS +---@class CShieldLandUnit : ShieldLandUnit CShieldLandUnit = Class(ShieldLandUnit) {} -- SHIELD STRUCTURES +---@class CShieldStructureUnit : ShieldStructureUnit CShieldStructureUnit = Class(ShieldStructureUnit) {} -- STRUCTURES +---@class CStructureUnit : StructureUnit CStructureUnit = Class(StructureUnit) {} -- SUBMARINE UNITS @@ -604,14 +617,18 @@ CWalkingLandUnit = DefaultUnitsFile.WalkingLandUnit CWallStructureUnit = Class(DefaultUnitsFile.WallStructureUnit) {} -- CIVILIAN STRUCTURES +---@class CCivilianStructureUnit : CStructureUnit CCivilianStructureUnit = Class(CStructureUnit) {} -- QUANTUM GATE UNITS +---@class CQuantumGateUnit : QuantumGateUnit CQuantumGateUnit = Class(QuantumGateUnit) {} -- RADAR JAMMER UNITS +---@class CRadarJammerUnit : RadarJammerUnit CRadarJammerUnit = Class(RadarJammerUnit) {} +---@class CConstructionEggUnit : CStructureUnit CConstructionEggUnit = Class(CStructureUnit) { OnStopBeingBuilt = function(self, builder, layer) LandFactoryUnit.OnStopBeingBuilt(self, builder, layer) diff --git a/lua/cybranweapons.lua b/lua/cybranweapons.lua index 5185f61b8f..dd43dec824 100644 --- a/lua/cybranweapons.lua +++ b/lua/cybranweapons.lua @@ -20,31 +20,37 @@ local Explosion = import('defaultexplosions.lua') local EffectTemplate = import('/lua/EffectTemplates.lua') local Util = import('utilities.lua') +---@class CDFBrackmanCrabHackPegLauncherWeapon : DefaultProjectileWeapon CDFBrackmanCrabHackPegLauncherWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/proton_cannon_muzzle_01_emit.bp', '/effects/emitters/proton_cannon_muzzle_02_emit.bp',}, } +---@class CDFParticleCannonWeapon : DefaultBeamWeapon CDFParticleCannonWeapon = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.ParticleCannonCollisionBeam, FxMuzzleFlash = {'/effects/emitters/particle_cannon_muzzle_01_emit.bp'}, } +---@class CDFProtonCannonWeapon : DefaultProjectileWeapon CDFProtonCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/proton_cannon_muzzle_01_emit.bp', '/effects/emitters/proton_cannon_muzzle_02_emit.bp',}, } +---@class CDFHvyProtonCannonWeapon : DefaultProjectileWeapon CDFHvyProtonCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CHvyProtonCannonMuzzleflash, } +---@class CDFOverchargeWeapon : OverchargeWeapon CDFOverchargeWeapon = Class(OverchargeWeapon) { FxMuzzleFlash = EffectTemplate.CMolecularRipperOverChargeFlash01, DesiredWeaponLabel = 'RightRipper' } -- COMMANDER ENHANCEMENT WEAPON! +---@class CDFHeavyMicrowaveLaserGeneratorCom : DefaultBeamWeapon CDFHeavyMicrowaveLaserGeneratorCom = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.MicrowaveLaserCollisionBeam02, FxMuzzleFlash = {}, @@ -65,6 +71,7 @@ CDFHeavyMicrowaveLaserGeneratorCom = Class(DefaultBeamWeapon) { } -- SPIDER BOT WEAPON! +---@class CDFHeavyMicrowaveLaserGenerator : DefaultBeamWeapon CDFHeavyMicrowaveLaserGenerator = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.MicrowaveLaserCollisionBeam01, FxMuzzleFlash = {}, @@ -115,18 +122,22 @@ CDFHeavyMicrowaveLaserGenerator = Class(DefaultBeamWeapon) { end, } +---@class CDFEMP : DefaultProjectileWeapon CDFEMP = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/laserturret_muzzle_flash_01_emit.bp',}, } +---@class CDFElectronBolterWeapon : DefaultProjectileWeapon CDFElectronBolterWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CElectronBolterMuzzleFlash01, } +---@class CDFHeavyElectronBolterWeapon : DefaultProjectileWeapon CDFHeavyElectronBolterWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CElectronBolterMuzzleFlash02, } +---@class CIFSmartCharge : DefaultProjectileWeapon CIFSmartCharge = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {}, CreateProjectileAtMuzzle = function(self, muzzle) @@ -139,9 +150,11 @@ CIFSmartCharge = Class(DefaultProjectileWeapon) { end, } +---@class CANTorpedoLauncherWeapon : DefaultProjectileWeapon CANTorpedoLauncherWeapon = Class(DefaultProjectileWeapon) { } +---@class CANNaniteTorpedoWeapon : DefaultProjectileWeapon CANNaniteTorpedoWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/default_muzzle_flash_01_emit.bp', @@ -171,14 +184,17 @@ CANNaniteTorpedoWeapon = Class(DefaultProjectileWeapon) { end, } +---@class CDFMissileMesonWeapon : DefaultProjectileWeapon CDFMissileMesonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {}, } +---@class CDFRocketIridiumWeapon : DefaultProjectileWeapon CDFRocketIridiumWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/muzzle_flash_01_emit.bp',}, } +---@class CDFRocketIridiumWeapon02 : DefaultProjectileWeapon CDFRocketIridiumWeapon02 = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/cybran_hoplight_muzzle_smoke_01_emit.bp', @@ -186,22 +202,27 @@ CDFRocketIridiumWeapon02 = Class(DefaultProjectileWeapon) { }, } +---@class CIFMissileCorsairWeapon : DefaultProjectileWeapon CIFMissileCorsairWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/muzzle_flash_01_emit.bp',}, } +---@class CDFLaserPulseLightWeapon : DefaultProjectileWeapon CDFLaserPulseLightWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CLaserMuzzleFlash01, } +---@class CDFLaserHeavyWeapon : DefaultProjectileWeapon CDFLaserHeavyWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CLaserMuzzleFlash02, } +---@class CDFLaserHeavyWeapon02 : DefaultProjectileWeapon CDFLaserHeavyWeapon02 = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CLaserMuzzleFlash03, } +---@class CDFLaserDisintegratorWeapon01 : DefaultProjectileWeapon CDFLaserDisintegratorWeapon01 = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = { '/effects/emitters/disintegrator_muzzle_charge_01_emit.bp', @@ -215,6 +236,7 @@ CDFLaserDisintegratorWeapon01 = Class(DefaultProjectileWeapon) { }, } +---@class CDFLaserDisintegratorWeapon02 : DefaultProjectileWeapon CDFLaserDisintegratorWeapon02 = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = { '/effects/emitters/disintegrator_muzzle_charge_03_emit.bp', @@ -226,6 +248,7 @@ CDFLaserDisintegratorWeapon02 = Class(DefaultProjectileWeapon) { }, } +---@class CDFHeavyDisintegratorWeapon : DefaultProjectileWeapon CDFHeavyDisintegratorWeapon = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = {}, FxMuzzleFlash = { @@ -237,9 +260,11 @@ CDFHeavyDisintegratorWeapon = Class(DefaultProjectileWeapon) { }, } +---@class CAAAutocannon : DefaultProjectileWeapon CAAAutocannon = Class(DefaultProjectileWeapon) { } +---@class CAANanoDartWeapon : DefaultProjectileWeapon CAANanoDartWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/cannon_muzzle_flash_04_emit.bp', @@ -247,6 +272,7 @@ CAANanoDartWeapon = Class(DefaultProjectileWeapon) { }, } +---@class CAABurstCloudFlakArtilleryWeapon : DefaultProjectileWeapon CAABurstCloudFlakArtilleryWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/default_muzzle_flash_01_emit.bp', @@ -275,22 +301,27 @@ CAABurstCloudFlakArtilleryWeapon = Class(DefaultProjectileWeapon) { end, } +---@class CAAMissileNaniteWeapon : DefaultProjectileWeapon CAAMissileNaniteWeapon = Class(DefaultProjectileWeapon) { -- Uses default muzzle flash } +---@class CIFGrenadeWeapon : DefaultProjectileWeapon CIFGrenadeWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_01_emit.bp',}, } +---@class CIFArtilleryWeapon : DefaultProjectileWeapon CIFArtilleryWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CArtilleryFlash01 } +---@class CIFMissileStrategicWeapon : DefaultProjectileWeapon CIFMissileStrategicWeapon = Class(DefaultProjectileWeapon) { } +---@class CIFMissileLoaTacticalWeapon : DefaultProjectileWeapon CIFMissileLoaTacticalWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/cybran_tactical_missile_launch_01_emit.bp', @@ -298,10 +329,12 @@ CIFMissileLoaTacticalWeapon = Class(DefaultProjectileWeapon) { }, } +---@class CIFBombNeutronWeapon : DefaultProjectileWeapon CIFBombNeutronWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_02_emit.bp',}, } +---@class CIFNaniteTorpedoWeapon : DefaultProjectileWeapon CIFNaniteTorpedoWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_02_emit.bp',}, @@ -329,14 +362,17 @@ CIFNaniteTorpedoWeapon = Class(DefaultProjectileWeapon) { } +---@class CIFMissileLoaWeapon : DefaultProjectileWeapon CIFMissileLoaWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CIFCruiseMissileLaunchSmoke, } +---@class CAMEMPMissileWeapon : DefaultProjectileWeapon CAMEMPMissileWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/missile_sam_muzzle_flash_01_emit.bp',}, } +---@class CAMZapperWeapon : DefaultBeamWeapon CAMZapperWeapon = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.ZapperCollisionBeam, @@ -382,11 +418,13 @@ CAMZapperWeapon = Class(DefaultBeamWeapon) { end, } +---@class CAMZapperWeapon02 : DefaultBeamWeapon CAMZapperWeapon02 = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.ZapperCollisionBeam, FxMuzzleFlash = {'/effects/emitters/cannon_muzzle_flash_01_emit.bp',}, } +---@class CAMZapperWeapon03 : DefaultBeamWeapon CAMZapperWeapon03 = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.ZapperCollisionBeam, @@ -432,17 +470,21 @@ CAMZapperWeapon03 = Class(DefaultBeamWeapon) { end, } +---@class CCannonMolecularWeapon : DefaultProjectileWeapon CCannonMolecularWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CMolecularRipperFlash01, } +---@class CEMPAutoCannon : DefaultProjectileWeapon CEMPAutoCannon = Class(DefaultProjectileWeapon) { } +---@class CKrilTorpedoLauncherWeapon : DefaultProjectileWeapon CKrilTorpedoLauncherWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.CKrilTorpedoLauncherMuzzleFlash01, } +---@class CMobileKamikazeBombWeapon : KamikazeWeapon CMobileKamikazeBombWeapon = Class(KamikazeWeapon){ FxDeath = EffectTemplate.CMobileKamikazeBombExplosion, diff --git a/lua/defaultantiprojectile.lua b/lua/defaultantiprojectile.lua index fc3faa28cb..b749a23269 100644 --- a/lua/defaultantiprojectile.lua +++ b/lua/defaultantiprojectile.lua @@ -10,7 +10,8 @@ local Entity = import('/lua/sim/Entity.lua').Entity local GetRandomFloat = import('/lua/utilities.lua').GetRandomFloat -Flare = Class(Entity) { +---@class Flare : Entity +Flare = Class(Entity){ OnCreate = function(self, spec) self.Army = self:GetArmy() self.Owner = spec.Owner @@ -32,7 +33,7 @@ Flare = Class(Entity) { end, } - +---@class DepthCharge : Entity DepthCharge = Class(Entity) { OnCreate = function(self, spec) self.Army = self:GetArmy() @@ -53,7 +54,7 @@ DepthCharge = Class(Entity) { end, } - +---@class MissileRedirect : Entity MissileRedirect = Class(Entity) { RedirectBeams = { '/effects/emitters/particle_cannon_beam_02_emit.bp' }, EndPointEffects = {'/effects/emitters/particle_cannon_end_01_emit.bp' }, diff --git a/lua/defaultcollisionbeams.lua b/lua/defaultcollisionbeams.lua index 1a68d7bb0c..6d1f74b7a0 100644 --- a/lua/defaultcollisionbeams.lua +++ b/lua/defaultcollisionbeams.lua @@ -15,6 +15,7 @@ local Util = import('utilities.lua') ------------------------------- -- Base class that defines supreme commander specific defaults ------------------------------- +---@class SCCollisionBeam : CollisionBeam SCCollisionBeam = Class(CollisionBeam) { FxImpactUnit = EffectTemplate.DefaultProjectileLandUnitImpact, FxImpactLand = {},-- EffectTemplate.DefaultProjectileLandImpact, @@ -29,6 +30,7 @@ SCCollisionBeam = Class(CollisionBeam) { ------------------------------- -- Ginsu COLLISION BEAM ------------------------------- +---@class GinsuCollisionBeam : SCCollisionBeam GinsuCollisionBeam = Class(SCCollisionBeam) { FxBeam = {'/effects/emitters/riot_gun_beam_01_emit.bp', '/effects/emitters/riot_gun_beam_02_emit.bp',}, @@ -46,6 +48,7 @@ GinsuCollisionBeam = Class(SCCollisionBeam) { ------------------------------------ -- PARTICLE CANNON COLLISION BEAM ------------------------------------ +---@class ParticleCannonCollisionBeam : SCCollisionBeam ParticleCannonCollisionBeam = Class(SCCollisionBeam) { FxBeam = { '/effects/emitters/particle_cannon_beam_01_emit.bp', @@ -61,6 +64,7 @@ ParticleCannonCollisionBeam = Class(SCCollisionBeam) { ------------------------------------ -- ZAPPER COLLISION BEAM ------------------------------------ +---@class ZapperCollisionBeam : SCCollisionBeam ZapperCollisionBeam = Class(SCCollisionBeam) { FxBeam = {'/effects/emitters/zapper_beam_01_emit.bp'}, FxBeamEndPoint = {'/effects/emitters/cannon_muzzle_flash_01_emit.bp', @@ -70,6 +74,7 @@ ZapperCollisionBeam = Class(SCCollisionBeam) { ------------------------------------ -- QUANTUM BEAM GENERATOR COLLISION BEAM ------------------------------------ +---@class QuantumBeamGeneratorCollisionBeam : SCCollisionBeam QuantumBeamGeneratorCollisionBeam = Class(SCCollisionBeam) { -- used by CZAR TerrainImpactType = 'LargeBeam02', TerrainImpactScale = 1, @@ -137,6 +142,7 @@ QuantumBeamGeneratorCollisionBeam = Class(SCCollisionBeam) { -- used by CZAR end, } +---@class DisruptorBeamCollisionBeam : SCCollisionBeam DisruptorBeamCollisionBeam = Class(SCCollisionBeam) { FxBeam = {'/effects/emitters/disruptor_beam_01_emit.bp'}, @@ -154,6 +160,7 @@ DisruptorBeamCollisionBeam = Class(SCCollisionBeam) { } +---@class MicrowaveLaserCollisionBeam01 : SCCollisionBeam MicrowaveLaserCollisionBeam01 = Class(SCCollisionBeam) { -- used by ML & cyb ACU TerrainImpactType = 'LargeBeam01', @@ -210,6 +217,7 @@ MicrowaveLaserCollisionBeam01 = Class(SCCollisionBeam) { -- used by ML & cyb ACU end, } +---@class MicrowaveLaserCollisionBeam02 : MicrowaveLaserCollisionBeam01 MicrowaveLaserCollisionBeam02 = Class(MicrowaveLaserCollisionBeam01) { TerrainImpactScale = 1, FxBeamStartPoint = EffectTemplate.CMicrowaveLaserMuzzle01, @@ -218,6 +226,7 @@ MicrowaveLaserCollisionBeam02 = Class(MicrowaveLaserCollisionBeam01) { } +---@class PhasonLaserCollisionBeam : SCCollisionBeam PhasonLaserCollisionBeam = Class(SCCollisionBeam) { -- used by GC TerrainImpactType = 'LargeBeam01', @@ -276,6 +285,7 @@ PhasonLaserCollisionBeam = Class(SCCollisionBeam) { -- used by GC +---@class TractorClawCollisionBeam : CollisionBeam TractorClawCollisionBeam = Class(CollisionBeam) { FxBeam = {EffectTemplate.ACollossusTractorBeam01}, @@ -287,6 +297,7 @@ TractorClawCollisionBeam = Class(CollisionBeam) { ------------------------------------ -- QUANTUM BEAM GENERATOR COLLISION BEAM ------------------------------------ +---@class ExperimentalPhasonLaserCollisionBeam : SCCollisionBeam ExperimentalPhasonLaserCollisionBeam = Class(SCCollisionBeam) { -- unknown unit (big size though) TerrainImpactType = 'LargeBeam01', @@ -356,6 +367,7 @@ ExperimentalPhasonLaserCollisionBeam = Class(SCCollisionBeam) { -- unknown unit +---@class UnstablePhasonLaserCollisionBeam : SCCollisionBeam UnstablePhasonLaserCollisionBeam = Class(SCCollisionBeam) { -- ythota death energy ball TerrainImpactType = 'LargeBeam01', @@ -415,6 +427,7 @@ UnstablePhasonLaserCollisionBeam = Class(SCCollisionBeam) { -- ythota death ener -- This is for sera destro and sera T2 point defense. +---@class UltraChromaticBeamGeneratorCollisionBeam : SCCollisionBeam UltraChromaticBeamGeneratorCollisionBeam = Class(SCCollisionBeam) { TerrainImpactType = 'LargeBeam01', @@ -472,6 +485,7 @@ UltraChromaticBeamGeneratorCollisionBeam = Class(SCCollisionBeam) { } -- This is for sera destro and sera T2 point defense. (adjustment for ship muzzleflash) +---@class UltraChromaticBeamGeneratorCollisionBeam02 : UltraChromaticBeamGeneratorCollisionBeam UltraChromaticBeamGeneratorCollisionBeam02 = Class(UltraChromaticBeamGeneratorCollisionBeam) { FxBeamStartPoint = EffectTemplate.SUltraChromaticBeamGeneratorMuzzle02, } @@ -479,6 +493,7 @@ UltraChromaticBeamGeneratorCollisionBeam02 = Class(UltraChromaticBeamGeneratorCo ------------------------------------ -- HIRO LASER COLLISION BEAM ------------------------------------ +---@class TDFHiroCollisionBeam : CollisionBeam TDFHiroCollisionBeam = Class(CollisionBeam) { -- used by UEF battlecruser TerrainImpactType = 'LargeBeam01', @@ -539,6 +554,7 @@ TDFHiroCollisionBeam = Class(CollisionBeam) { -- used by UEF battlecruser ------------------------------------ -- ORBITAL DEATH LASER COLLISION BEAM ------------------------------------ +---@class OrbitalDeathLaserCollisionBeam : SCCollisionBeam OrbitalDeathLaserCollisionBeam = Class(SCCollisionBeam) { -- used by satellite TerrainImpactType = 'LargeBeam02', TerrainImpactScale = 1, diff --git a/lua/defaultunits.lua b/lua/defaultunits.lua index 07138c296d..6392b435e8 100644 --- a/lua/defaultunits.lua +++ b/lua/defaultunits.lua @@ -24,6 +24,7 @@ local StructureUnitRotateTowardsEnemiesArtillery = categories.ARTILLERY * (categ local StructureUnitOnStartBeingBuiltRotateBuildings = categories.STRUCTURE * (categories.DIRECTFIRE + categories.INDIRECTFIRE) * (categories.DEFENSE + categories.ARTILLERY) -- STRUCTURE UNITS +---@class StructureUnit : Unit StructureUnit = Class(Unit) { LandBuiltHiddenBones = {'Floatation'}, MinConsumptionPerSecondEnergy = 1, @@ -637,6 +638,7 @@ StructureUnit = Class(Unit) { } -- FACTORY UNITS +---@class FactoryUnit : StructureUnit FactoryUnit = Class(StructureUnit) { OnCreate = function(self) StructureUnit.OnCreate(self) @@ -999,12 +1001,15 @@ FactoryUnit = Class(StructureUnit) { } -- AIR FACTORY UNITS +---@class AirFactoryUnit : FactoryUnit AirFactoryUnit = Class(FactoryUnit) {} -- AIR STAGING PLATFORMS UNITS +---@class AirStagingPlatformUnit : StructureUnit AirStagingPlatformUnit = Class(StructureUnit) { } -- ENERGY CREATION UNITS +---@class ConcreteStructureUnit : StructureUnit ConcreteStructureUnit = Class(StructureUnit) { OnCreate = function(self) StructureUnit.OnCreate(self) @@ -1013,15 +1018,19 @@ ConcreteStructureUnit = Class(StructureUnit) { } -- ENERGY CREATION UNITS +---@class EnergyCreationUnit : StructureUnit EnergyCreationUnit = Class(StructureUnit) { } -- ENERGY STORAGE UNITS +---@class EnergyStorageUnit : StructureUnit EnergyStorageUnit = Class(StructureUnit) { } -- LAND FACTORY UNITS +---@class LandFactoryUnit : FactoryUnit LandFactoryUnit = Class(FactoryUnit) {} -- MASS COLLECTION UNITS +---@class MassCollectionUnit : StructureUnit MassCollectionUnit = Class(StructureUnit) { OnConsumptionActive = function(self) @@ -1144,8 +1153,10 @@ MassCollectionUnit = Class(StructureUnit) { } -- MASS FABRICATION UNITS +---@class MassFabricationUnit : StructureUnit MassFabricationUnit = Class(StructureUnit) { + ---@param self MassFabricationUnit OnScriptBitSet = function(self, bit) if bit == 4 then -- no longer track us, we want to be disabled @@ -1158,6 +1169,7 @@ MassFabricationUnit = Class(StructureUnit) { end end, + ---@param self MassFabricationUnit OnScriptBitClear = function (self, bit) if bit == 4 then -- make brain track us to enable / disable accordingly @@ -1167,6 +1179,7 @@ MassFabricationUnit = Class(StructureUnit) { end end, + ---@param self MassFabricationUnit OnStopBeingBuilt = function(self, builder, layer) StructureUnit.OnStopBeingBuilt(self, builder, layer) self:SetMaintenanceConsumptionActive() @@ -1238,9 +1251,11 @@ MassFabricationUnit = Class(StructureUnit) { } -- MASS STORAGE UNITS +---@class MassStorageUnit : StructureUnit MassStorageUnit = Class(StructureUnit) { } -- RADAR UNITS +---@class RadarUnit : StructureUnit RadarUnit = Class(StructureUnit) { OnStopBeingBuilt = function(self, builder, layer) @@ -1260,6 +1275,7 @@ RadarUnit = Class(StructureUnit) { } -- RADAR JAMMER UNITS +---@class RadarJammerUnit : StructureUnit RadarJammerUnit = Class(StructureUnit) { -- Shut down intel while upgrading @@ -1308,6 +1324,7 @@ RadarJammerUnit = Class(StructureUnit) { } -- SONAR UNITS +---@class SonarUnit : StructureUnit SonarUnit = Class(StructureUnit) { OnStopBeingBuilt = function(self, builder, layer) @@ -1353,6 +1370,7 @@ SonarUnit = Class(StructureUnit) { } -- SEA FACTORY UNITS +---@class SeaFactoryUnit : FactoryUnit SeaFactoryUnit = Class(FactoryUnit) { DestroyUnitBeingBuilt = function(self) if self.UnitBeingBuilt and not self.UnitBeingBuilt.Dead and self.UnitBeingBuilt:GetFractionComplete() < 1 then @@ -1362,9 +1380,11 @@ SeaFactoryUnit = Class(FactoryUnit) { } -- SHIELD STRCUTURE UNITS +---@class ShieldStructureUnit : StructureUnit ShieldStructureUnit = Class(StructureUnit) { } -- TRANSPORT BEACON UNITS +---@class TransportBeaconUnit : StructureUnit TransportBeaconUnit = Class(StructureUnit) { FxTransportBeacon = {'/effects/emitters/red_beacon_light_01_emit.bp'}, @@ -1383,12 +1403,15 @@ TransportBeaconUnit = Class(StructureUnit) { } -- WALL STRCUTURE UNITS +---@class WallStructureUnit : StructureUnit WallStructureUnit = Class(StructureUnit) { } -- QUANTUM GATE UNITS +---@class QuantumGateUnit : FactoryUnit QuantumGateUnit = Class(FactoryUnit) { } -- MOBILE UNITS +---@class MobileUnit : Unit MobileUnit = Class(Unit) { -- Added for engymod. When created, units must re-check their build restrictions @@ -1453,6 +1476,7 @@ MobileUnit = Class(Unit) { } -- WALKING LAND UNITS +---@class WalkingLandUnit : MobileUnit WalkingLandUnit = Class(MobileUnit) { WalkingAnim = nil, WalkingAnimRate = 1, @@ -1496,6 +1520,7 @@ WalkingLandUnit = Class(MobileUnit) { -- SUB UNITS -- These units typically float under the water and have wake when they move +---@class SubUnit : MobileUnit SubUnit = Class(MobileUnit) { -- Use default spark effect until underwater damaged states are made FxDamage1 = { EffectTemplate.DamageSparks01 }, @@ -1518,6 +1543,7 @@ SubUnit = Class(MobileUnit) { } -- AIR UNITS +---@class AirUnit : MobileUnit AirUnit = Class(MobileUnit) { -- Contrails ContrailEffects = {'/effects/emitters/contrail_polytrail_01_emit.bp', }, @@ -1723,6 +1749,7 @@ AirUnit = Class(MobileUnit) { --- Mixin transports (air, sea, space, whatever). Sellotape onto concrete transport base classes as desired. local slotsData = {} +---@class BaseTransport BaseTransport = Class() { OnTransportAttach = function(self, attachBone, unit) self:PlayUnitSound('Load') @@ -1791,6 +1818,7 @@ BaseTransport = Class() { } --- Base class for air transports. +---@class BaseTransport : AirUnit AirTransport = Class(AirUnit, BaseTransport) { OnTransportAborted = function(self) end, @@ -1862,9 +1890,11 @@ AirTransport = Class(AirUnit, BaseTransport) { } -- LAND UNITS +---@class LandUnit : MobileUnit LandUnit = Class(MobileUnit) {} -- CONSTRUCTION UNITS +---@class ConstructionUnit : MobileUnit ConstructionUnit = Class(MobileUnit) { OnCreate = function(self) MobileUnit.OnCreate(self) @@ -1995,6 +2025,7 @@ ConstructionUnit = Class(MobileUnit) { -- SEA UNITS -- These units typically float on the water and have wake when they move +---@class SeaUnit : MobileUnit SeaUnit = Class(MobileUnit){ DeathThreadDestructionWaitTime = 0, ShowUnitDestructionDebris = false, @@ -2008,6 +2039,7 @@ SeaUnit = Class(MobileUnit){ } --- Base class for aircraft carriers. +---@class AircraftCarrier : SeaUnit AircraftCarrier = Class(SeaUnit, BaseTransport) { OnKilled = function(self, instigator, type, overkillRatio) self:SaveCargoMass() @@ -2017,8 +2049,10 @@ AircraftCarrier = Class(SeaUnit, BaseTransport) { } -- HOVERING LAND UNITS +---@class HoverLandUnit : MobileUnit HoverLandUnit = Class(MobileUnit) { } +---@class SlowHoverLandUnit : HoverLandUnit SlowHoverLandUnit = Class(HoverLandUnit) { OnLayerChange = function(self, new, old) @@ -2039,8 +2073,10 @@ SlowHoverLandUnit = Class(HoverLandUnit) { } -- AMPHIBIOUS LAND UNITS +---@class AmphibiousLandUnit : MobileUnit AmphibiousLandUnit = Class(MobileUnit) { } +---@class SlowAmphibiousLandUnit : AmphibiousLandUnit SlowAmphibiousLandUnit = Class(AmphibiousLandUnit) { OnLayerChange = function(self, new, old) @@ -2057,6 +2093,7 @@ SlowAmphibiousLandUnit = Class(AmphibiousLandUnit) { } --- Base class for command units. +---@class CommandUnit : WalkingLandUnit CommandUnit = Class(WalkingLandUnit) { DeathThreadDestructionWaitTime = 2, @@ -2293,6 +2330,7 @@ CommandUnit = Class(WalkingLandUnit) { end, } +---@class ACUUnit : CommandUnit ACUUnit = Class(CommandUnit) { -- The "commander under attack" warnings. CreateShield = function(self, bpShield) @@ -2455,10 +2493,13 @@ ACUUnit = Class(CommandUnit) { } -- SHIELD HOVER UNITS +---@class ShieldHoverLandUnit : HoverLandUnit ShieldHoverLandUnit = Class(HoverLandUnit) {} -- SHIELD LAND UNITS +---@class ShieldLandUnit : LandUnit ShieldLandUnit = Class(LandUnit) {} -- SHIELD SEA UNITS +---@class ShieldSeaUnit : SeaUnit ShieldSeaUnit = Class(SeaUnit) {} diff --git a/lua/globalInit.lua b/lua/globalInit.lua index 97da45d119..394dcd2dfc 100644 --- a/lua/globalInit.lua +++ b/lua/globalInit.lua @@ -1,3 +1,4 @@ +---@declare-global -- Copyright © 2005 Gas Powered Games, Inc. All rights reserved. -- -- This is the top-level lua initialization file. It is run at initialization time diff --git a/lua/kirvesbeams.lua b/lua/kirvesbeams.lua index 43486701f4..6b80098f50 100644 --- a/lua/kirvesbeams.lua +++ b/lua/kirvesbeams.lua @@ -4,6 +4,7 @@ local CustomEffectTemplate = import('/lua/kirveseffects.lua') local SCCollisionBeam = import('/lua/defaultcollisionbeams.lua').SCCollisionBeam local Util = import('/lua/utilities.lua') +---@class EmptyCollisionBeam : CollisionBeam EmptyCollisionBeam = Class(CollisionBeam) { FxImpactUnit = {}, FxImpactLand = {},--EffectTemplate.DefaultProjectileLandImpact, @@ -16,18 +17,21 @@ EmptyCollisionBeam = Class(CollisionBeam) { } +---@class TargetingCollisionBeam : EmptyCollisionBeam TargetingCollisionBeam = Class(EmptyCollisionBeam) { FxBeam = { '/effects/emitters/targetting_beam_01_emit.bp' }, } +---@class TargetingCollisionBeamInvisible : EmptyCollisionBeam TargetingCollisionBeamInvisible = Class(EmptyCollisionBeam) { FxBeam = { '/effects/emitters/targeting_beam_invisible.bp' }, } +---@class UnstablePhasonLaserCollisionBeam : SCCollisionBeam UnstablePhasonLaserCollisionBeam = Class(SCCollisionBeam) { TerrainImpactType = 'LargeBeam01', @@ -50,6 +54,7 @@ UnstablePhasonLaserCollisionBeam = Class(SCCollisionBeam) { } +---@class UnstablePhasonLaserCollisionBeam2 : SCCollisionBeam UnstablePhasonLaserCollisionBeam2 = Class(SCCollisionBeam) { TerrainImpactType = 'LargeBeam01', diff --git a/lua/kirvesprojectiles.lua b/lua/kirvesprojectiles.lua index 78e0ca4a50..ae80ecac3f 100644 --- a/lua/kirvesprojectiles.lua +++ b/lua/kirvesprojectiles.lua @@ -2,6 +2,7 @@ local DefaultProjectileFile = import('/lua/sim/defaultprojectiles.lua') local MultiPolyTrailProjectile = DefaultProjectileFile.MultiPolyTrailProjectile local EffectTemplate = import('/lua/EffectTemplates.lua') +---@class TShellPhalanxProjectile : MultiPolyTrailProjectile TShellPhalanxProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = EffectTemplate.TPhalanxGunPolyTrails, PolyTrailOffset = EffectTemplate.TPhalanxGunPolyTrailsOffsets, diff --git a/lua/kirvesweapons.lua b/lua/kirvesweapons.lua index dfe9b1dac3..8f9fa3862d 100644 --- a/lua/kirvesweapons.lua +++ b/lua/kirvesweapons.lua @@ -10,17 +10,20 @@ local CollisionBeamFile = import('/lua/kirvesbeams.lua') +---@class TargetingLaser : DefaultBeamWeapon TargetingLaser = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.TargetingCollisionBeam, FxMuzzleFlash = {'/effects/emitters/particle_cannon_muzzle_01_emit.bp'}, FxBeamEndPointScale = 0.01, } +---@class TargetingLaserInvisible : TargetingLaser TargetingLaserInvisible = Class(TargetingLaser) { BeamType = CollisionBeamFile.TargetingCollisionBeamInvisible, FxMuzzleFlash = {}, } +---@class TAAPhalanxWeapon : DefaultProjectileWeapon TAAPhalanxWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TPhalanxGunMuzzleFlash, FxShellEject = EffectTemplate.TPhalanxGunShells, @@ -34,6 +37,7 @@ TAAPhalanxWeapon = Class(DefaultProjectileWeapon) { end, } +---@class SDFUnstablePhasonBeam : DefaultBeamWeapon SDFUnstablePhasonBeam = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.UnstablePhasonLaserCollisionBeam, FxMuzzleFlash = {}, @@ -43,6 +47,7 @@ SDFUnstablePhasonBeam = Class(DefaultBeamWeapon) { } +---@class SDFUnstablePhasonBeam2 : DefaultBeamWeapon SDFUnstablePhasonBeam2 = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.UnstablePhasonLaserCollisionBeam2, FxMuzzleFlash = {}, @@ -52,6 +57,7 @@ SDFUnstablePhasonBeam2 = Class(DefaultBeamWeapon) { FxBeamEndPointScale = 0.01, } +---@class Dummy : DefaultBeamWeapon Dummy = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.TargetingCollisionBeam, diff --git a/lua/maui/bitmap.lua b/lua/maui/bitmap.lua index 1442848bd6..a1e52ba957 100644 --- a/lua/maui/bitmap.lua +++ b/lua/maui/bitmap.lua @@ -27,9 +27,10 @@ -- width, height GetTextureDimensions(filename) -local Control = import('control.lua').Control -local ScaleNumber = import('layouthelpers.lua').ScaleNumber +local Control = import('/lua/maui/control.lua').Control +local ScaleNumber = import('/lua/maui/layouthelpers.lua').ScaleNumber +---@class Bitmap : moho.bitmap_methods, Control Bitmap = Class(moho.bitmap_methods, Control) { __init = function(self, parent, filename, debugname) diff --git a/lua/maui/button.lua b/lua/maui/button.lua index 27ff63ef29..925f9d9001 100644 --- a/lua/maui/button.lua +++ b/lua/maui/button.lua @@ -2,6 +2,7 @@ local Bitmap = import('bitmap.lua').Bitmap local Dragger = import('dragger.lua').Dragger local UIUtil = import('/lua/ui/uiutil.lua') +---@class Button : Bitmap Button = Class(Bitmap) { __init = function(self, parent, normal, active, highlight, disabled, clickCue, rolloverCue, frameRate) @@ -116,6 +117,7 @@ Button = Class(Bitmap) { --- A button that can optionally have its textures "fixed" to some value. This is special-snowflaking -- for the retarded construction UI, and can probably be got rid of when we think of a better way of -- doing this. For now this at least gets this bollocks out of the Button class. +---@class FixableButton : Button FixableButton = Class(Button) { __init = function(self, parent, normal, active, highlight, disabled, clickCue, rolloverCue, frameRate) Button.__init(self, parent, normal, active, highlight, disabled, clickCue, rolloverCue, frameRate) diff --git a/lua/maui/control.lua b/lua/maui/control.lua index 66900323ee..c7d4caa7ba 100644 --- a/lua/maui/control.lua +++ b/lua/maui/control.lua @@ -25,6 +25,7 @@ -- SetName(string name) -- Dump() +---@class Control : moho.control_methods Control = Class(moho.control_methods) { -- reset the control's layout to the defaults, in this case diff --git a/lua/maui/cursor.lua b/lua/maui/cursor.lua index da06a14580..e9bb0d7f97 100644 --- a/lua/maui/cursor.lua +++ b/lua/maui/cursor.lua @@ -3,6 +3,7 @@ -- SetDefaultTexture(filename, hotspotX, hotspotY) -- Reset() -- re-applies default texture +---@class Cursor : moho.cursor_methods Cursor = Class(moho.cursor_methods) { __init = function(self, defaultTexture, defaultHotspotX, defaultHotspotY) _c_CreateCursor(self, nil) diff --git a/lua/maui/edit.lua b/lua/maui/edit.lua index 21ebea123d..de0a4024d1 100644 --- a/lua/maui/edit.lua +++ b/lua/maui/edit.lua @@ -34,6 +34,7 @@ local Control = import('control.lua').Control local AddUnicodeCharToEditText = import('/lua/UTF.lua').AddUnicodeCharToEditText local ScaleNumber = import('layouthelpers.lua').ScaleNumber +---@class Edit : moho.edit_methods, Control Edit = Class(moho.edit_methods, Control) { __init = function(self, parent, debugname) diff --git a/lua/maui/frame.lua b/lua/maui/frame.lua index d638260ee1..33e235400f 100644 --- a/lua/maui/frame.lua +++ b/lua/maui/frame.lua @@ -3,6 +3,7 @@ local Control = import('control.lua').Control +---@class Frame : moho.frame_methods, Control Frame = Class(moho.frame_methods, Control) { __init = function(self, debugname) diff --git a/lua/maui/grid.lua b/lua/maui/grid.lua index 4597df2fd8..0c50c7a3dc 100644 --- a/lua/maui/grid.lua +++ b/lua/maui/grid.lua @@ -3,6 +3,7 @@ local Group = import('group.lua').Group local ScaleNumber = import('layouthelpers.lua').ScaleNumber local LazyVar = import('/lua/lazyvar.lua') +---@class Grid : Group Grid = Class(Group) { -- note that the grid "assumes" your entries will be the correct width and height but doesn't enforce it -- controls could be bigger or smaller, it's up to you, but if they're bigger they will overlap as only diff --git a/lua/maui/itemlist.lua b/lua/maui/itemlist.lua index 6aba48b294..49ad4b5b42 100644 --- a/lua/maui/itemlist.lua +++ b/lua/maui/itemlist.lua @@ -19,6 +19,7 @@ local Control = import('control.lua').Control local Dragger = import('dragger.lua').Dragger local ScaleNumber = import('layouthelpers.lua').ScaleNumber +---@class ItemList : moho.item_list_methods, Control ItemList = Class(moho.item_list_methods, Control) { __init = function(self, parent, debugname) diff --git a/lua/maui/text.lua b/lua/maui/text.lua index 62b4faf439..bfb62f0905 100644 --- a/lua/maui/text.lua +++ b/lua/maui/text.lua @@ -11,6 +11,7 @@ local Control = import('control.lua').Control local ScaleNumber = import('layouthelpers.lua').ScaleNumber +---@class Text : moho.text_methods, Control Text = Class(moho.text_methods, Control) { __init = function(self, parent, debugname) diff --git a/lua/maui/window.lua b/lua/maui/window.lua index 9fea5d4d9d..96896a6c2d 100644 --- a/lua/maui/window.lua +++ b/lua/maui/window.lua @@ -69,6 +69,7 @@ styles = { cursorFunc = UIUtil.GetCursor, } +---@class Window : Group Window = Class(Group) { __init = function(self, parent, title, icon, pin, config, lockSize, lockPosition, prefID, defaultPosition, textureTable) Group.__init(self, parent, tostring(title) .. "-window") diff --git a/lua/platoon.lua b/lua/platoon.lua index 951bac3328..e15edc6007 100644 --- a/lua/platoon.lua +++ b/lua/platoon.lua @@ -23,6 +23,7 @@ local SPAI = import('/lua/ScenarioPlatoonAI.lua') --for sorian AI local SUtils = import('/lua/AI/sorianutilities.lua') +---@class Platoon : moho.platoon_methods Platoon = Class(moho.platoon_methods) { NeedCoolDown = false, LastAttackDestination = {}, diff --git a/lua/proptree.lua b/lua/proptree.lua index 07f76d806f..398317e7ab 100644 --- a/lua/proptree.lua +++ b/lua/proptree.lua @@ -37,6 +37,7 @@ local EffectScaleEmitter = EffectMethods.ScaleEmitter local EffectOffsetEmitter = EffectMethods.OffsetEmitter local EffectSetEmitterCurveParam = EffectMethods.SetEmitterCurveParam +---@class Tree : Prop Tree = Class(Prop) { OnDestroy = function(self) @@ -233,6 +234,7 @@ Tree = Class(Prop) { end, } +---@class TreeGroup : Prop TreeGroup = Class(Prop) { --- Break when colliding with a projectile of some sort diff --git a/lua/seraphimprojectiles.lua b/lua/seraphimprojectiles.lua index 8472045825..87dc34f673 100644 --- a/lua/seraphimprojectiles.lua +++ b/lua/seraphimprojectiles.lua @@ -25,6 +25,7 @@ local RandomFloat = import('/lua/utilities.lua').GetRandomFloat -------------------------------------------------------------------------- -- SERAPHIM ANTI-NUKE PROJECTILES -------------------------------------------------------------------------- +---@class SIFHuAntiNuke : SinglePolyTrailProjectile SIFHuAntiNuke = Class(SinglePolyTrailProjectile) { FxImpactTrajectoryAligned = false, PolyTrail = EffectTemplate.SKhuAntiNukePolyTrail, @@ -37,6 +38,7 @@ SIFHuAntiNuke = Class(SinglePolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class SIFKhuAntiNukeTendril : EmitterProjectile SIFKhuAntiNukeTendril = Class(EmitterProjectile) { FxImpactTrajectoryAligned = false, -- PolyTrail = EffectTemplate.SKhuAntiNukePolyTrail, @@ -50,6 +52,7 @@ SIFKhuAntiNukeTendril = Class(EmitterProjectile) { } +---@class SIFKhuAntiNukeSmallTendril : EmitterProjectile SIFKhuAntiNukeSmallTendril = Class(EmitterProjectile) { FxImpactTrajectoryAligned = false, FxTrails = EffectTemplate.SKhuAntiNukeHitSmallTendrilFxTrails, @@ -65,6 +68,7 @@ SIFKhuAntiNukeSmallTendril = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- TEMPORARY BASE SERAPHIM PROJECTILE -------------------------------------------------------------------------- +---@class SBaseTempProjectile : EmitterProjectile SBaseTempProjectile = Class(EmitterProjectile) { FxImpactLand = EffectTemplate.AMissileHit01, FxImpactNone = EffectTemplate.AMissileHit01, @@ -78,6 +82,7 @@ SBaseTempProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- SERAPHIM CHRONATRON CANNONS -------------------------------------------------------------------------- +---@class SChronatronCannon : MultiPolyTrailProjectile SChronatronCannon = Class(MultiPolyTrailProjectile) { -- ACU FxImpactTrajectoryAligned = false, FxImpactLand = EffectTemplate.SChronotronCannonLandHit, @@ -91,6 +96,7 @@ SChronatronCannon = Class(MultiPolyTrailProjectile) { -- ACU PolyTrailOffset = {0,0,0}, } +---@class SChronatronCannonOverCharge : MultiPolyTrailProjectile SChronatronCannonOverCharge = Class(MultiPolyTrailProjectile) { -- ACU FxImpactTrajectoryAligned = false, FxImpactLand = EffectTemplate.SChronotronCannonOverChargeLandHit, @@ -102,6 +108,7 @@ SChronatronCannonOverCharge = Class(MultiPolyTrailProjectile) { -- ACU PolyTrailOffset = {0,0,0}, } +---@class SLightChronatronCannon : MultiPolyTrailProjectile SLightChronatronCannon = Class(MultiPolyTrailProjectile) { -- SACU FxImpactTrajectoryAligned = false, FxImpactLand = EffectTemplate.SLightChronotronCannonLandHit, @@ -115,6 +122,7 @@ SLightChronatronCannon = Class(MultiPolyTrailProjectile) { -- SACU FxImpactUnderWater = EffectTemplate.SLightChronotronCannonHit, } +---@class SLightChronatronCannonOverCharge : MultiPolyTrailProjectile SLightChronatronCannonOverCharge = Class(MultiPolyTrailProjectile) { -- SACU FxImpactTrajectoryAligned = false, FxImpactLand = EffectTemplate.SLightChronotronCannonOverChargeHit, @@ -129,6 +137,7 @@ SLightChronatronCannonOverCharge = Class(MultiPolyTrailProjectile) { -- SACU -------------------------------------------------------------------------- -- SERAPHIM PHASIC AUTOGUNS -------------------------------------------------------------------------- +---@class SPhasicAutogun : MultiPolyTrailProjectile SPhasicAutogun = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.PhasicAutoGunHit, FxImpactNone = EffectTemplate.PhasicAutoGunHit, @@ -138,6 +147,7 @@ SPhasicAutogun = Class(MultiPolyTrailProjectile) { PolyTrailOffset = {0,0}, } +---@class SHeavyPhasicAutogun : MultiPolyTrailProjectile SHeavyPhasicAutogun = Class(MultiPolyTrailProjectile) { -- T2 gunship and T2 transport FxImpactLand = EffectTemplate.HeavyPhasicAutoGunHit, FxImpactNone = EffectTemplate.HeavyPhasicAutoGunHit, @@ -151,6 +161,7 @@ SHeavyPhasicAutogun = Class(MultiPolyTrailProjectile) { -- T2 gunship and T2 tra } -- Adjustment for XSA0203 projectile speed. : T2 gunship +---@class SHeavyPhasicAutogun02 : SHeavyPhasicAutogun SHeavyPhasicAutogun02 = Class(SHeavyPhasicAutogun) { PolyTrails = EffectTemplate.HeavyPhasicAutoGunProjectileTrail02, FxTrails = EffectTemplate.HeavyPhasicAutoGunProjectileTrailGlow02, @@ -159,6 +170,7 @@ SHeavyPhasicAutogun02 = Class(SHeavyPhasicAutogun) { -------------------------------------------------------------------------- -- SERAPHIM OH CANNONS -------------------------------------------------------------------------- +---@class SOhCannon : MultiPolyTrailProjectile SOhCannon = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.OhCannonHit, FxImpactNone = EffectTemplate.OhCannonHit, @@ -169,6 +181,7 @@ SOhCannon = Class(MultiPolyTrailProjectile) { PolyTrailOffset = {0,0}, } +---@class SOhCannon02 : MultiPolyTrailProjectile SOhCannon02 = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.OhCannonHit, FxImpactNone = EffectTemplate.OhCannonHit, @@ -182,6 +195,7 @@ SOhCannon02 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM SHRIEKER AUTO-CANNONS -------------------------------------------------------------------------- +---@class SShriekerAutoCannon : MultiPolyTrailProjectile SShriekerAutoCannon = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.ShriekerCannonHit, @@ -197,6 +211,7 @@ SShriekerAutoCannon = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM AIRE-AU BOLTER -------------------------------------------------------------------------- +---@class SAireauBolter : MultiPolyTrailProjectile SAireauBolter = Class(MultiPolyTrailProjectile) { -- T2 bot (Ilshavoh) and T3 tank (Othuum) FxImpactLand = EffectTemplate.SAireauBolterHit, FxImpactNone = EffectTemplate.SAireauBolterHit, @@ -210,6 +225,7 @@ SAireauBolter = Class(MultiPolyTrailProjectile) { -- T2 bot (Ilshavoh) and T3 ta -------------------------------------------------------------------------- -- SERAPHIM TAU CANNON -------------------------------------------------------------------------- +---@class STauCannon : MultiPolyTrailProjectile STauCannon = Class(MultiPolyTrailProjectile) { -- sera T2 hover tank and T3 tank (othuum) FxImpactLand = EffectTemplate.STauCannonHit, FxImpactNone = EffectTemplate.STauCannonHit, @@ -223,6 +239,7 @@ STauCannon = Class(MultiPolyTrailProjectile) { -- sera T2 hover tank and T3 tank ------------------------------------------------------------------------ -- SERAPHIM HEAVY QUARNON CANNON -------------------------------------------------------------------------- +---@class SHeavyQuarnonCannon : MultiPolyTrailProjectile SHeavyQuarnonCannon = Class(MultiPolyTrailProjectile) { -- Battleship FxImpactLand = EffectTemplate.SHeavyQuarnonCannonLandHit, FxImpactNone = EffectTemplate.SHeavyQuarnonCannonHit, @@ -237,6 +254,7 @@ SHeavyQuarnonCannon = Class(MultiPolyTrailProjectile) { -- Battleship ------------------------------------------------------------------------ -- SERAPHIM LAANSE TACTICAL MISSILE -------------------------------------------------------------------------- +---@class SLaanseTacticalMissile : SinglePolyTrailProjectile SLaanseTacticalMissile = Class(SinglePolyTrailProjectile) { -- ACU / SACU / TML /MML FxImpactLand = EffectTemplate.SLaanseMissleHit, FxImpactProp = EffectTemplate.SLaanseMissleHitUnit, @@ -254,6 +272,7 @@ SLaanseTacticalMissile = Class(SinglePolyTrailProjectile) { -- ACU / SACU / TML -------------------------------------------------------------------------- -- SERAPHIM ZTHUTHAAM ARTILLERY SHELL -------------------------------------------------------------------------- +---@class SZthuthaamArtilleryShell : MultiPolyTrailProjectile SZthuthaamArtilleryShell = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.SZthuthaamArtilleryHit, FxImpactWater = EffectTemplate.SZthuthaamArtilleryHit, @@ -270,6 +289,7 @@ SZthuthaamArtilleryShell = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM SUTHANUS ARTILLERY SHELL -------------------------------------------------------------------------- +---@class SSuthanusArtilleryShell : EmitterProjectile SSuthanusArtilleryShell = Class(EmitterProjectile) { FxImpactTrajectoryAligned = false, FxImpactLand = EffectTemplate.SRifterArtilleryHit, @@ -286,6 +306,7 @@ SSuthanusArtilleryShell = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- SERAPHIM MOBILE SUTHANUS ARTILLERY SHELL -------------------------------------------------------------------------- +---@class SSuthanusMobileArtilleryShell : SinglePolyTrailProjectile SSuthanusMobileArtilleryShell = Class(SinglePolyTrailProjectile) { -- This will make ist so that the projectile effects are the in the space of the world FxImpactTrajectoryAligned = false, @@ -303,6 +324,7 @@ SSuthanusMobileArtilleryShell = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM THUNTHO ARTILLERY SHELL -------------------------------------------------------------------------- +---@class SThunthoArtilleryShell : MultiPolyTrailProjectile SThunthoArtilleryShell = Class(MultiPolyTrailProjectile) { FxImpactTrajectoryAligned = false, FxImpactLand = EffectTemplate.SThunderStormCannonHit, @@ -317,6 +339,7 @@ SThunthoArtilleryShell = Class(MultiPolyTrailProjectile) { } +---@class SThunthoArtilleryShell2 : MultiPolyTrailProjectile SThunthoArtilleryShell2 = Class(MultiPolyTrailProjectile) { FxImpactTrajectoryAligned = false, FxImpactLand = EffectTemplate.SThunderStormCannonLandHit, @@ -334,6 +357,7 @@ SThunthoArtilleryShell2 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM SHLEO AA GATLING ROUND -------------------------------------------------------------------------- +---@class SShleoAACannon : EmitterProjectile SShleoAACannon = Class(EmitterProjectile) { FxImpactAirUnit = EffectTemplate.SShleoCannonUnitHit, FxImpactLand = EffectTemplate.SShleoCannonLandHit, @@ -359,6 +383,7 @@ SShleoAACannon = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- SERAPHIM OLARIS AA ARTILLERY -------------------------------------------------------------------------- +---@class SOlarisAAArtillery : MultiPolyTrailProjectile SOlarisAAArtillery = Class(MultiPolyTrailProjectile) { FxImpactAirUnit = EffectTemplate.SOlarisCannonHit, FxImpactLand = EffectTemplate.SOlarisCannonHit, @@ -373,6 +398,7 @@ SOlarisAAArtillery = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM LOSAARE AA CANNON -------------------------------------------------------------------------- +---@class SLosaareAAAutoCannon : MultiPolyTrailProjectile SLosaareAAAutoCannon = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.SLosaareAutoCannonHit, @@ -386,6 +412,7 @@ SLosaareAAAutoCannon = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM LOSAARE AA CANNON (XSS0303 / XSS0304 ADJUSTMENTS) -------------------------------------------------------------------------- +---@class SLosaareAAAutoCannon02 : SLosaareAAAutoCannon SLosaareAAAutoCannon02 = Class(SLosaareAAAutoCannon) { PolyTrails = EffectTemplate.SLosaareAutoCannonProjectileTrail02, @@ -410,6 +437,7 @@ SOtheTacticalBomb= Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM ANA-IT TORPEDO -------------------------------------------------------------------------- +---@class SAnaitTorpedo : MultiPolyTrailProjectile SAnaitTorpedo = Class(MultiPolyTrailProjectile) { FxImpactUnderWater = EffectTemplate.SAnaitTorpedoHit, FxUnderWaterHitScale = 1, @@ -428,6 +456,7 @@ SAnaitTorpedo = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM HEAVY CAVITATION TORPEDO -------------------------------------------------------------------------- +---@class SHeavyCavitationTorpedo : MultiPolyTrailProjectile SHeavyCavitationTorpedo = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.SHeavyCavitationTorpedoHit, FxImpactNone = EffectTemplate.SHeavyCavitationTorpedoHit, @@ -448,6 +477,7 @@ SHeavyCavitationTorpedo = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM UALL CAVITATION TORPEDO (SUB LAUNCHED TORPEDO) -------------------------------------------------------------------------- +---@class SUallCavitationTorpedo : SinglePolyTrailProjectile SUallCavitationTorpedo = Class(SinglePolyTrailProjectile) { -- FxImpactLand = EffectTemplate.SUallTorpedoHit, -- FxImpactNone = EffectTemplate.SUallTorpedoHit, @@ -509,6 +539,7 @@ SExperimentalStrategicMissile = Class(NukeProjectile, MultiPolyTrailProjectile) -------------------------------------------------------------------------- -- SERAPHIM ELECTRUM TACTICAL MISSILE DEFENSE -------------------------------------------------------------------------- +---@class SIMAntiMissile01 : MultiPolyTrailProjectile SIMAntiMissile01 = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.SElectrumMissleDefenseHit, FxImpactNone= EffectTemplate.SElectrumMissleDefenseHit, @@ -522,10 +553,12 @@ SIMAntiMissile01 = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- INAINO EXPERIMENTAL STRATEGIC BOMB -------------------------------------------------------------------------- +---@class SExperimentalStrategicBomb : SBaseTempProjectile SExperimentalStrategicBomb = Class(SBaseTempProjectile) { FxImpactTrajectoryAligned = false, } +---@class SIFNukeWaveTendril : EmitterProjectile SIFNukeWaveTendril = Class(EmitterProjectile) { FxImpactTrajectoryAligned = false, -- FxTrails = EffectTemplate.SInfernoHitWaveTendril, -- TODO: Assign something to this one that is usable. @@ -537,6 +570,7 @@ SIFNukeWaveTendril = Class(EmitterProjectile) { FxImpactUnderWater = {}, } +---@class SIFNukeSpiralTendril : EmitterProjectile SIFNukeSpiralTendril = Class(EmitterProjectile) { FxImpactTrajectoryAligned = false, -- FxTrails = EffectTemplate.SInfernoHitSpiralTendril, -- TODO: Assign something to this one that is usable. @@ -551,6 +585,7 @@ SIFNukeSpiralTendril = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- ENERGY BEING 'LASER' PROJECTILE WEAPON -------------------------------------------------------------------------- +---@class SEnergyLaser : SBaseTempProjectile SEnergyLaser = Class(SBaseTempProjectile) { } @@ -558,6 +593,7 @@ SEnergyLaser = Class(SBaseTempProjectile) { -------------------------------------------------------------------------- -- T3 BOMBER BOMB WEAPON -------------------------------------------------------------------------- +---@class SZhanaseeBombProjectile : EmitterProjectile SZhanaseeBombProjectile = Class(EmitterProjectile) { FxImpactTrajectoryAligned = false, FxTrails = EffectTemplate.SZhanaseeBombFxTrails01, @@ -571,6 +607,7 @@ SZhanaseeBombProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- HOTHE DECOY FLARE PROJECTILE -------------------------------------------------------------------------- +---@class SAAHotheFlareProjectile : EmitterProjectile SAAHotheFlareProjectile = Class(EmitterProjectile) { FxTrails = EffectTemplate.AAntiMissileFlare, FxImpactUnit = {}, @@ -605,6 +642,7 @@ SAAHotheFlareProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- SERAPHIM OHWALLI STRATEGIC BOMB PROJECTILE -------------------------------------------------------------------------- +---@class SOhwalliStrategicBombProjectile : MultiPolyTrailProjectile SOhwalliStrategicBombProjectile = Class(MultiPolyTrailProjectile) { FxTrails = EffectTemplate.SOhwalliBombFxTrails01, PolyTrails = EffectTemplate.SOhwalliBombPolyTrails, @@ -619,6 +657,7 @@ SOhwalliStrategicBombProjectile = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- ANJELLU TORPEDO DEFENSE PROJECTILE -------------------------------------------------------------------------- +---@class SAnjelluTorpedoDefenseProjectile : MultiPolyTrailProjectile SAnjelluTorpedoDefenseProjectile = Class(MultiPolyTrailProjectile) { FxImpactProjectileUnderWater = EffectTemplate.SDFAjelluAntiTorpedoHit01, PolyTrails = EffectTemplate.SDFAjelluAntiTorpedoPolyTrail01, @@ -628,6 +667,7 @@ SAnjelluTorpedoDefenseProjectile = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- SERAPHIM SNIPER ENERGY RIFLE -------------------------------------------------------------------------- +---@class SDFSniperShotNormal : MultiPolyTrailProjectile SDFSniperShotNormal = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.SDFSniperShotNormalHit, FxImpactNone = EffectTemplate.SDFSniperShotNormalHit, @@ -640,6 +680,7 @@ SDFSniperShotNormal = Class(MultiPolyTrailProjectile) { PolyTrailOffset = {0,0}, } +---@class SDFSniperShot : MultiPolyTrailProjectile SDFSniperShot = Class(MultiPolyTrailProjectile) { FxImpactLand = EffectTemplate.SDFSniperShotHit, FxImpactNone = EffectTemplate.SDFSniperShotHit, @@ -656,6 +697,7 @@ SDFSniperShot = Class(MultiPolyTrailProjectile) { -- SERAPHIM EXPERIMENTAL PHASON BEAM PROJECTILE -------------------------------------------------------------------------- +---@class SDFExperimentalPhasonProjectile : EmitterProjectile SDFExperimentalPhasonProjectile = Class(EmitterProjectile) { -- ythotha FxImpactTrajectoryAligned = false, FxTrails = EffectTemplate.SDFExperimentalPhasonProjFXTrails01, @@ -665,6 +707,7 @@ SDFExperimentalPhasonProjectile = Class(EmitterProjectile) { -- ythotha FxImpactWater = EffectTemplate.SDFExperimentalPhasonProjHit01, } +---@class SDFSinnuntheWeaponProjectile : EmitterProjectile SDFSinnuntheWeaponProjectile = Class(EmitterProjectile) { -- ythotha FxTrails = EffectTemplate.SDFSinnutheWeaponFXTrails01, FxImpactUnit = EffectTemplate.SDFSinnutheWeaponHitUnit, @@ -673,6 +716,7 @@ SDFSinnuntheWeaponProjectile = Class(EmitterProjectile) { -- ythotha FxImpactWater = EffectTemplate.SDFSinnutheWeaponHit, } +---@class SDFAireauProjectile : MultiPolyTrailProjectile SDFAireauProjectile = Class(MultiPolyTrailProjectile) { -- ythotha FxImpactNone = EffectTemplate.SDFAireauWeaponHit01, FxImpactUnit = EffectTemplate.SDFAireauWeaponHitUnit, diff --git a/lua/seraphimunits.lua b/lua/seraphimunits.lua index 322b9f57cf..574b8bc559 100644 --- a/lua/seraphimunits.lua +++ b/lua/seraphimunits.lua @@ -36,6 +36,7 @@ local EffectUtil = import('/lua/EffectUtilities.lua') local CreateSeraphimFactoryBuildingEffects = EffectUtil.CreateSeraphimFactoryBuildingEffects -- FACTORIES +---@class SFactoryUnit : FactoryUnit SFactoryUnit = Class(FactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) local BuildBones = self.BuildEffectBones @@ -67,6 +68,7 @@ SFactoryUnit = Class(FactoryUnit) { } -- AIR STRUCTURES +---@class SAirFactoryUnit : AirFactoryUnit SAirFactoryUnit = Class(AirFactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) SFactoryUnit.StartBuildFx(self, unitBeingBuilt) @@ -232,19 +234,23 @@ SAirFactoryUnit = Class(AirFactoryUnit) { } -- AIR UNITS +---@class SAirUnit : AirUnit SAirUnit = Class(AirUnit) { ContrailEffects = {'/effects/emitters/contrail_ser_polytrail_01_emit.bp'} } -- AIR STAGING STRUCTURES +---@class SAirStagingPlatformUnit : AirStagingPlatformUnit SAirStagingPlatformUnit = Class(AirStagingPlatformUnit) {} -- WALL STRUCTURES +---@class SConcreteStructureUnit : ConcreteStructureUnit SConcreteStructureUnit = Class(ConcreteStructureUnit) { AdjacencyBeam = false, } -- Construction Units +---@class SConstructionUnit : ConstructionUnit SConstructionUnit = Class(ConstructionUnit) { OnCreate = function(self) ConstructionUnit.OnCreate(self) @@ -307,6 +313,7 @@ SConstructionUnit = Class(ConstructionUnit) { } -- ENERGY CREATION UNITS +---@class SEnergyCreationUnit : EnergyCreationUnit SEnergyCreationUnit = Class(EnergyCreationUnit) { OnCreate = function(self) EnergyCreationUnit.OnCreate(self) @@ -324,6 +331,7 @@ SEnergyCreationUnit = Class(EnergyCreationUnit) { } -- ENERGY STORAGE STRUCTURES +---@class SEnergyStorageUnit : EnergyStorageUnit SEnergyStorageUnit = Class(EnergyStorageUnit) {} -- HOVERING LAND UNITS @@ -334,6 +342,7 @@ SHoverLandUnit = Class(DefaultUnitsFile.HoverLandUnit) { } -- LAND FACTORY STRUCTURES +---@class SLandFactoryUnit : LandFactoryUnit SLandFactoryUnit = Class(LandFactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) SFactoryUnit.StartBuildFx(self, unitBeingBuilt) @@ -416,21 +425,27 @@ SLandFactoryUnit = Class(LandFactoryUnit) { SLandUnit = Class(DefaultUnitsFile.LandUnit) {} -- MASS COLLECTION UNITS +---@class SMassCollectionUnit : MassCollectionUnit SMassCollectionUnit = Class(MassCollectionUnit) {} -- MASS FABRICATION STRUCTURES +---@class SMassFabricationUnit : MassFabricationUnit SMassFabricationUnit = Class(MassFabricationUnit) {} -- MASS STORAGE UNITS +---@class SMassStorageUnit : MassStorageUnit SMassStorageUnit = Class(MassStorageUnit) {} -- RADAR STRUCTURES +---@class SRadarUnit : RadarUnit SRadarUnit = Class(RadarUnit) {} -- RADAR STRUCTURES +---@class SSonarUnit : SonarUnit SSonarUnit = Class(SonarUnit) {} -- SEA FACTORY STRUCTURES +---@class SSeaFactoryUnit : SeaFactoryUnit SSeaFactoryUnit = Class(SeaFactoryUnit) { StartBuildFx = function(self, unitBeingBuilt) SFactoryUnit.StartBuildFx(self, unitBeingBuilt) @@ -513,12 +528,15 @@ SSeaFactoryUnit = Class(SeaFactoryUnit) { SSeaUnit = Class(DefaultUnitsFile.SeaUnit) {} -- SHIELD LAND UNITS +---@class SShieldHoverLandUnit : ShieldHoverLandUnit SShieldHoverLandUnit = Class(ShieldHoverLandUnit) {} -- SHIELD LAND UNITS +---@class SShieldLandUnit : ShieldLandUnit SShieldLandUnit = Class(ShieldLandUnit) {} -- SHIELD STRUCTURES +---@class SShieldStructureUnit : ShieldStructureUnit SShieldStructureUnit = Class(ShieldStructureUnit) { OnShieldEnabled = function(self) ShieldStructureUnit.OnShieldEnabled(self) @@ -540,6 +558,7 @@ SShieldStructureUnit = Class(ShieldStructureUnit) { } -- STRUCTURES +---@class SStructureUnit : StructureUnit SStructureUnit = Class(StructureUnit) {} -- SUBMARINE UNITS @@ -558,15 +577,19 @@ SWalkingLandUnit = DefaultUnitsFile.WalkingLandUnit SWallStructureUnit = Class(DefaultUnitsFile.WallStructureUnit) {} -- CIVILIAN STRUCTURES +---@class SCivilianStructureUnit : SStructureUnit SCivilianStructureUnit = Class(SStructureUnit) {} -- QUANTUM GATE UNITS +---@class SQuantumGateUnit : QuantumGateUnit SQuantumGateUnit = Class(QuantumGateUnit) {} -- RADAR JAMMER UNITS +---@class SRadarJammerUnit : RadarJammerUnit SRadarJammerUnit = Class(RadarJammerUnit) {} -- Seraphim energy ball units +---@class SEnergyBallUnit : SHoverLandUnit SEnergyBallUnit = Class(SHoverLandUnit) { timeAlive = 0, diff --git a/lua/seraphimweapons.lua b/lua/seraphimweapons.lua index e3b53620de..61fd0e3aa0 100644 --- a/lua/seraphimweapons.lua +++ b/lua/seraphimweapons.lua @@ -24,73 +24,89 @@ local PhasonLaserCollisionBeam = CollisionBeamFile.PhasonLaserCollisionBeam local TractorClawCollisionBeam = CollisionBeamFile.TractorClawCollisionBeam local EffectTemplate = import('/lua/EffectTemplates.lua') +---@class SANAnaitTorpedo : DefaultProjectileWeapon SANAnaitTorpedo = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SAnaitTorpedoMuzzleFlash, } +---@class SDFExperimentalPhasonProj : DefaultProjectileWeapon SDFExperimentalPhasonProj = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SDFExperimentalPhasonProjMuzzleFlash, FxChargeMuzzleFlash = EffectTemplate.SDFExperimentalPhasonProjChargeMuzzleFlash, } +---@class SDFAireauWeapon : DefaultProjectileWeapon SDFAireauWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SDFAireauWeaponMuzzleFlash, } +---@class SDFSinnuntheWeapon : DefaultProjectileWeapon SDFSinnuntheWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SDFSinnutheWeaponMuzzleFlash, FxChargeMuzzleFlash = EffectTemplate.SDFSinnutheWeaponChargeMuzzleFlash } +---@class SIFInainoWeapon : DefaultProjectileWeapon SIFInainoWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SIFInainoLaunch01, } +---@class SIFHuAntiNukeWeapon : DefaultProjectileWeapon SIFHuAntiNukeWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SKhuAntiNukeMuzzleFlash, } +---@class SIFExperimentalStrategicMissile : DefaultProjectileWeapon SIFExperimentalStrategicMissile = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SIFExperimentalStrategicMissileLaunch01, FxChargeMuzzleFlash = EffectTemplate.SIFExperimentalStrategicMissileChargeLaunch01, } +---@class SDFPhasicAutoGunWeapon : DefaultProjectileWeapon SDFPhasicAutoGunWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.PhasicAutoGunMuzzleFlash, } +---@class SDFHeavyPhasicAutoGunTankWeapon : DefaultProjectileWeapon SDFHeavyPhasicAutoGunTankWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.HeavyPhasicAutoGunTankMuzzleFlash, } +---@class SDFHeavyPhasicAutoGunWeapon : DefaultProjectileWeapon SDFHeavyPhasicAutoGunWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.HeavyPhasicAutoGunMuzzleFlash, } +---@class SDFOhCannon : DefaultProjectileWeapon SDFOhCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.OhCannonMuzzleFlash, } +---@class SDFOhCannon02 : DefaultProjectileWeapon SDFOhCannon02 = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.OhCannonMuzzleFlash02, } +---@class SDFShriekerCannon : DefaultProjectileWeapon SDFShriekerCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.ShriekerCannonMuzzleFlash, } -- Units: XSL0111 +---@class SIFLaanseTacticalMissileLauncher : DefaultProjectileWeapon SIFLaanseTacticalMissileLauncher = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SLaanseMissleMuzzleFlash, } -- Units: XSB2303 +---@class SIFZthuthaamArtilleryCannon : DefaultProjectileWeapon SIFZthuthaamArtilleryCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash= EffectTemplate.SZthuthaamArtilleryMuzzleFlash, FxChargeMuzzleFlash= EffectTemplate.SZthuthaamArtilleryChargeMuzzleFlash, } -- Units: XSL0303 +---@class SDFThauCannon : DefaultProjectileWeapon SDFThauCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.STauCannonMuzzleFlash, FxMuzzleTerrainTypeName = 'ThauTerrainMuzzle', @@ -110,90 +126,110 @@ SDFThauCannon = Class(DefaultProjectileWeapon) { } -- Units: XSL0303 +---@class SDFAireauBolterWeapon : DefaultProjectileWeapon SDFAireauBolterWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SAireauBolterMuzzleFlash, } -- Units: XSL0202 +---@class SDFAireauBolterWeapon02 : DefaultProjectileWeapon SDFAireauBolterWeapon02 = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SAireauBolterMuzzleFlash02, } -- Units: XSL0303 +---@class SANUallCavitationTorpedo : DefaultProjectileWeapon SANUallCavitationTorpedo = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SUallTorpedoMuzzleFlash } +---@class SANAnaitTorpedo : DefaultProjectileWeapon SANAnaitTorpedo = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SAnaitTorpedoMuzzleFlash } +---@class SANHeavyCavitationTorpedo : DefaultProjectileWeapon SANHeavyCavitationTorpedo = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SHeavyCavitationTorpedoMuzzleFlash } +---@class SANHeavyCavitationTorpedo02 : DefaultProjectileWeapon SANHeavyCavitationTorpedo02 = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SHeavyCavitationTorpedoMuzzleFlash02 } +---@class SDFChronotronCannonWeapon : DefaultProjectileWeapon SDFChronotronCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SChronotronCannonMuzzle, FxChargeMuzzleFlash = EffectTemplate.SChronotronCannonMuzzleCharge, } +---@class SDFChronotronCannonOverChargeWeapon : OverchargeWeapon SDFChronotronCannonOverChargeWeapon = Class(OverchargeWeapon) { FxMuzzleFlash = EffectTemplate.SChronotronCannonOverChargeMuzzle, DesiredWeaponLabel = 'ChronotronCannon' } -- Units: XSL0301 +---@class SDFLightChronotronCannonWeapon : DefaultProjectileWeapon SDFLightChronotronCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SLightChronotronCannonMuzzleFlash, } +---@class SDFLightChronotronCannonOverchargeWeapon : OverchargeWeapon SDFLightChronotronCannonOverchargeWeapon = Class(OverchargeWeapon) { FxMuzzleFlash = EffectTemplate.SLightChronotronCannonOverChargeMuzzleFlash, DesiredWeaponLabel = 'LightChronatronCannon' } +---@class SAAShleoCannonWeapon : DefaultProjectileWeapon SAAShleoCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SShleoCannonMuzzleFlash, } +---@class SAAOlarisCannonWeapon : DefaultProjectileWeapon SAAOlarisCannonWeapon = Class(DefaultProjectileWeapon) { FxChargeEffects = EffectTemplate.SOlarisCannonMuzzleCharge, FxMuzzleFlash = EffectTemplate.SOlarisCannonMuzzleFlash01, } +---@class SAALosaareAutoCannonWeapon : DefaultProjectileWeapon SAALosaareAutoCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SLosaareAutoCannonMuzzleFlash, } +---@class SAALosaareAutoCannonWeaponAirUnit : DefaultProjectileWeapon SAALosaareAutoCannonWeaponAirUnit = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SLosaareAutoCannonMuzzleFlashAirUnit, } +---@class SAALosaareAutoCannonWeaponSeaUnit : DefaultProjectileWeapon SAALosaareAutoCannonWeaponSeaUnit = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SLosaareAutoCannonMuzzleFlashSeaUnit, } +---@class SDFAjelluAntiTorpedoDefense : DefaultProjectileWeapon SDFAjelluAntiTorpedoDefense = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SDFAjelluAntiTorpedoLaunch01, } +---@class SIFThunthoCannonWeapon : DefaultProjectileWeapon SIFThunthoCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SThunderStormCannonMuzzleFlash, } +---@class SIFSuthanusArtilleryCannon : DefaultProjectileWeapon SIFSuthanusArtilleryCannon = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = EffectTemplate.SRifterArtilleryChargeMuzzleFlash, FxMuzzleFlash = EffectTemplate.SRifterArtilleryMuzzleFlash, } +---@class SIFSuthanusMobileArtilleryCannon : DefaultProjectileWeapon SIFSuthanusMobileArtilleryCannon = Class(DefaultProjectileWeapon) { FxChargeMuzzleFlash = EffectTemplate.SRifterMobileArtilleryChargeMuzzleFlash, FxMuzzleFlash = EffectTemplate.SRifterMobileArtilleryMuzzleFlash, } +---@class SDFExperimentalPhasonLaser : DefaultBeamWeapon SDFExperimentalPhasonLaser = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.ExperimentalPhasonLaserCollisionBeam, FxMuzzleFlash = {}, @@ -215,6 +251,7 @@ SDFExperimentalPhasonLaser = Class(DefaultBeamWeapon) { end, } +---@class SDFUnstablePhasonBeam : DefaultBeamWeapon SDFUnstablePhasonBeam = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.UnstablePhasonLaserCollisionBeam, FxMuzzleFlash = {}, @@ -223,6 +260,7 @@ SDFUnstablePhasonBeam = Class(DefaultBeamWeapon) { FxUpackingChargeEffectScale = 1, } +---@class SDFUltraChromaticBeamGenerator : DefaultBeamWeapon SDFUltraChromaticBeamGenerator = Class(DefaultBeamWeapon) { BeamType = CollisionBeamFile.UltraChromaticBeamGeneratorCollisionBeam, FxMuzzleFlash = {}, @@ -244,41 +282,51 @@ SDFUltraChromaticBeamGenerator = Class(DefaultBeamWeapon) { end, } +---@class SDFUltraChromaticBeamGenerator02 : SDFUltraChromaticBeamGenerator SDFUltraChromaticBeamGenerator02 = Class(SDFUltraChromaticBeamGenerator) { BeamType = CollisionBeamFile.UltraChromaticBeamGeneratorCollisionBeam02, } +---@class SLaanseMissileWeapon : DefaultProjectileWeapon SLaanseMissileWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SLaanseMissleMuzzleFlash, } +---@class SExperimentalStrategicMissileWeapon : DefaultProjectileWeapon SExperimentalStrategicMissileWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SExperimentalStrategicMissileMuzzleFlash, } +---@class SAMElectrumMissileDefense : DefaultProjectileWeapon SAMElectrumMissileDefense = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SElectrumMissleDefenseMuzzleFlash, } +---@class SDFBombOtheWeapon : DefaultProjectileWeapon SDFBombOtheWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SOtheBombMuzzleFlash, } +---@class SIFBombZhanaseeWeapon : DefaultProjectileWeapon SIFBombZhanaseeWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SZhanaseeMuzzleFlash01, } +---@class SDFHeavyQuarnonCannon : DefaultProjectileWeapon SDFHeavyQuarnonCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SHeavyQuarnonCannonMuzzleFlash, } +---@class SDFSniperShotNormalMode : DefaultProjectileWeapon SDFSniperShotNormalMode = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SDFSniperShotNormalMuzzleFlash, } +---@class SDFSniperShotSniperMode : DefaultProjectileWeapon SDFSniperShotSniperMode = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.SDFSniperShotMuzzleFlash, } +---@class SB0OhwalliExperimentalStrategicBombWeapon : DefaultProjectileWeapon SB0OhwalliExperimentalStrategicBombWeapon = Class(DefaultProjectileWeapon) { } diff --git a/lua/shield.lua b/lua/shield.lua index 26f8e876f4..7c1330b906 100644 --- a/lua/shield.lua +++ b/lua/shield.lua @@ -130,6 +130,8 @@ for k, bp in __blueprints do end end +---@class Shield : moho.shield_methods, Entity +---@field Brain AIBrain Shield = Class(moho.shield_methods, Entity) { __init = function(self, spec, owner) -- This key deviates in name from the blueprints... @@ -142,6 +144,8 @@ Shield = Class(moho.shield_methods, Entity) { _c_CreateShield(self, spec) end, + ---@param self Shield + ---@param spec unknown is this Entity? OnCreate = function(self, spec) -- cache information that is used frequently self.Army = EntityGetArmy(self) @@ -300,6 +304,7 @@ Shield = Class(moho.shield_methods, Entity) { end end, + ---@param self Shield OnEnergyDepleted = function(self) self.NoEnergyToSustain = true @@ -309,6 +314,7 @@ Shield = Class(moho.shield_methods, Entity) { end end, + ---@param self Shield OnEnergyViable = function(self) self.NoEnergyToSustain = false @@ -1014,6 +1020,7 @@ Shield = Class(moho.shield_methods, Entity) { } --- A bubble shield attached to a single unit. +---@class PersonalBubble : Shield PersonalBubble = Class(Shield) { OnCreate = function(self, spec) Shield.OnCreate(self, spec) @@ -1085,6 +1092,7 @@ PersonalBubble = Class(Shield) { --- A personal bubble that can render a set of encompassed units invincible. -- Useful for shielded transports (to work around the area-damage bug). +---@class TransportShield : Shield TransportShield = Class(Shield) { OnCreate = function(self, spec) @@ -1158,6 +1166,7 @@ TransportShield = Class(Shield) { --- A shield that sticks to the surface of the unit. Doesn't have its own collision physics, just -- grants extra health. +---@class PersonalShield : Shield PersonalShield = Class(Shield){ OnCreate = function(self, spec) Shield.OnCreate(self, spec) @@ -1251,6 +1260,7 @@ PersonalShield = Class(Shield){ end, } +---@class AntiArtilleryShield : Shield AntiArtilleryShield = Class(Shield) { OnCreate = function(self, spec) Shield.OnCreate(self, spec) @@ -1297,6 +1307,7 @@ AntiArtilleryShield = Class(Shield) { } -- Pretty much the same as personal shield (no collisions), but has its own mesh and special effects. +---@class CzarShield : PersonalShield CzarShield = Class(PersonalShield) { OnCreate = function(self, spec) PersonalShield.OnCreate(self, spec) diff --git a/lua/sim/BrainConditionsMonitor.lua b/lua/sim/BrainConditionsMonitor.lua index d00d79fbb1..7900694b6c 100644 --- a/lua/sim/BrainConditionsMonitor.lua +++ b/lua/sim/BrainConditionsMonitor.lua @@ -8,7 +8,8 @@ --** Copyright © 2005 Gas Powered Games, Inc. All rights reserved. --**************************************************************************** -BrainConditionsMonitor = Class { +---@class BrainConditionsMonitor +BrainConditionsMonitor = ClassSimple { PreCreate = function(self) if self.PreCreateFinished then @@ -212,13 +213,15 @@ BrainConditionsMonitor = Class { end, } +---@return BrainConditionsMonitor function CreateConditionsMonitor(brain) local cMonitor = BrainConditionsMonitor() cMonitor:Create(brain) return cMonitor end -Condition = Class { +---@class Condition +Condition = ClassSimple { -- Create the thing Create = function(self,brain,key) self.Status = false @@ -240,6 +243,7 @@ Condition = Class { end } +---@class ImportCondition : Condition ImportCondition = Class(Condition) { Create = function(self,brain,key,filename,funcName,funcData) Condition.Create(self,brain,key) @@ -282,6 +286,7 @@ ImportCondition = Class(Condition) { end, } +---@class InstantImportCondition : Condition InstantImportCondition = Class(Condition) { Create = function(self,brain,key,filename,funcName,funcData) Condition.Create(self,brain,key) @@ -331,6 +336,7 @@ InstantImportCondition = Class(Condition) { end, } +---@class FunctionCondition : Condition FunctionCondition = Class(Condition) { Create = function(self,brain,key,funcHandle,funcParams) Condition.Create(self,brain,key) diff --git a/lua/sim/Builder.lua b/lua/sim/Builder.lua index e0c536bf45..0454385c0c 100644 --- a/lua/sim/Builder.lua +++ b/lua/sim/Builder.lua @@ -19,7 +19,8 @@ local AIUtils = import('/lua/ai/aiutilities.lua') -- BuilderConditions = list of functions that return true/false, list of args, { < function>, {}} -- } -Builder = Class { +---@class Builder +Builder = ClassSimple { Create = function(self, brain, data, locationType) -- make sure the table of strings exist, they are required for the builder local verifyDictionary = { 'Priority', 'BuilderName' } @@ -240,6 +241,7 @@ end -- PlatoonBuildCallbacks = {FunctionsToCallBack when the platoon starts to build} --} +---@class FactoryBuilder : Builder FactoryBuilder = Class(Builder) { Create = function(self,brain,data,locationType) Builder.Create(self,brain,data,locationType) @@ -269,6 +271,7 @@ end -- PlatoonAddFunctions = { other functions to run when platoon is formed } --} +---@class PlatoonBuilder : Builder PlatoonBuilder = Class(Builder) { Create = function(self,brain,data,locationType) Builder.Create(self,brain,data,locationType) @@ -359,6 +362,7 @@ end -- } --} +---@class EngineerBuilder : PlatoonBuilder EngineerBuilder = Class(PlatoonBuilder) { Create = function(self,brain,data, locationType) PlatoonBuilder.Create(self,brain,data, locationType) diff --git a/lua/sim/BuilderManager.lua b/lua/sim/BuilderManager.lua index c0f672e2d0..625ba1f84a 100644 --- a/lua/sim/BuilderManager.lua +++ b/lua/sim/BuilderManager.lua @@ -11,7 +11,8 @@ local AIUtils = import('/lua/ai/aiutilities.lua') local Builder = import('/lua/sim/Builder.lua') local AIBuildUnits = import('/lua/ai/aibuildunits.lua') -BuilderManager = Class { +---@class BuilderManager +BuilderManager = ClassSimple { Create = function(self, brain) self.Trash = TrashBag() self.Brain = brain diff --git a/lua/sim/CollisionBeam.lua b/lua/sim/CollisionBeam.lua index e76447668f..5ba9eb33f5 100644 --- a/lua/sim/CollisionBeam.lua +++ b/lua/sim/CollisionBeam.lua @@ -14,6 +14,7 @@ local DefaultDamage = import('/lua/sim/defaultdamage.lua') local ScenarioFramework = import('/lua/ScenarioFramework.lua') +---@class CollisionBeam : moho.CollisionBeamEntity CollisionBeam = Class(moho.CollisionBeamEntity) { FxBeam = {}, diff --git a/lua/sim/DefaultProjectiles.lua b/lua/sim/DefaultProjectiles.lua index aa2e1b35f7..290afd7266 100644 --- a/lua/sim/DefaultProjectiles.lua +++ b/lua/sim/DefaultProjectiles.lua @@ -31,12 +31,13 @@ local IEffectOffsetEmitter = _G.moho.IEffect.OffsetEmitter ----------------------------------------------------------------- -- Null Shell ----------------------------------------------------------------- +---@class NullShell : Projectile NullShell = Class(Projectile) {} ----------------------------------------------------------------- -- PROJECTILE WITH ATTACHED EFFECT EMITTERS ----------------------------------------------------------------- - +---@class EmitterProjectile : Projectile EmitterProjectile = Class(Projectile) { FxTrails = {'/effects/emitters/missile_munition_trail_01_emit.bp',}, FxTrailScale = 1, @@ -64,6 +65,7 @@ EmitterProjectile = Class(Projectile) { ----------------------------------------------------------------- -- BEAM PROJECTILES ----------------------------------------------------------------- +---@class SingleBeamProjectile : EmitterProjectile SingleBeamProjectile = Class(EmitterProjectile) { BeamName = '/effects/emitters/default_beam_01_emit.bp', @@ -78,6 +80,7 @@ SingleBeamProjectile = Class(EmitterProjectile) { end, } +---@class MultiBeamProjectile : EmitterProjectile MultiBeamProjectile = Class(EmitterProjectile) { Beams = {'/effects/emitters/default_beam_01_emit.bp',}, @@ -94,6 +97,7 @@ MultiBeamProjectile = Class(EmitterProjectile) { } -- Nukes +---@class NukeProjectile : NullShell NukeProjectile = Class(NullShell) { MovementThread = function(self) local launcher = self:GetLauncher() @@ -208,6 +212,7 @@ NukeProjectile = Class(NullShell) { ----------------------------------------------------------------- -- POLY-TRAIL PROJECTILES ----------------------------------------------------------------- +---@class SinglePolyTrailProjectile : EmitterProjectile SinglePolyTrailProjectile = Class(EmitterProjectile) { PolyTrail = '/effects/emitters/test_missile_trail_emit.bp', @@ -231,6 +236,7 @@ SinglePolyTrailProjectile = Class(EmitterProjectile) { -- upvalue for performance +---@class MultiPolyTrailProjectile : EmitterProjectile MultiPolyTrailProjectile = Class(EmitterProjectile) { PolyTrails = {'/effects/emitters/test_missile_trail_emit.bp'}, @@ -278,6 +284,7 @@ MultiPolyTrailProjectile = Class(EmitterProjectile) { ----------------------------------------------------------------- -- LIGHTWEIGHT VERSION THAT LIMITS USE TO 1 BEAM, 1 POLYTRAIL, AND STANDARD EMITTERS +---@class SingleCompositeEmitterProjectile : SinglePolyTrailProjectile SingleCompositeEmitterProjectile = Class(SinglePolyTrailProjectile) { BeamName = '/effects/emitters/default_beam_01_emit.bp', @@ -293,6 +300,7 @@ SingleCompositeEmitterProjectile = Class(SinglePolyTrailProjectile) { } -- HEAVYWEIGHT VERSION, ALLOWS FOR MULTIPLE BEAMS, POLYTRAILS, AND STANDARD EMITTERS +---@class MultiCompositeEmitterProjectile : MultiPolyTrailProjectile MultiCompositeEmitterProjectile = Class(MultiPolyTrailProjectile) { Beams = {'/effects/emitters/default_beam_01_emit.bp',}, @@ -314,6 +322,7 @@ MultiCompositeEmitterProjectile = Class(MultiPolyTrailProjectile) { ----------------------------------------------------------------- -- TRAIL ON ENTERING WATER PROJECTILE ----------------------------------------------------------------- +---@class OnWaterEntryEmitterProjectile : Projectile OnWaterEntryEmitterProjectile = Class(Projectile) { FxTrails = {'/effects/emitters/torpedo_munition_trail_01_emit.bp',}, FxTrailScale = 1, @@ -418,6 +427,7 @@ local EntityGetPositionXYZ = EntityMethods.GetPositionXYZ local EmitterMethods = _G.moho.IEffect local EmitterScaleEmitter = EmitterMethods.ScaleEmitter +---@class BaseGenericDebris : DummyProjectile BaseGenericDebris = Class(DummyProjectile){ OnImpact = function(self, targetType, targetEntity) @@ -479,6 +489,7 @@ BaseGenericDebris = Class(DummyProjectile){ -- PROJECTILE THAT ADJUSTS DAMAGE AND ENERGY COST ON IMPACT ----------------------------------------------------------- +---@class OverchargeProjectile OverchargeProjectile = Class() { OnImpact = function(self, targetType, targetEntity) -- Stop us doing blueprint damage in the other OnImpact call if we ditch this one without resetting self.DamageData diff --git a/lua/sim/EngineerManager.lua b/lua/sim/EngineerManager.lua index c9936f1b6a..ed576e37cd 100644 --- a/lua/sim/EngineerManager.lua +++ b/lua/sim/EngineerManager.lua @@ -10,6 +10,7 @@ local AIUtils = import('/lua/ai/aiutilities.lua') local Builder = import('/lua/sim/Builder.lua') local AIBuildUnits = import('/lua/ai/aibuildunits.lua') +---@class EngineerManager : BuilderManager EngineerManager = Class(BuilderManager) { Create = function(self, brain, lType, location, radius) BuilderManager.Create(self,brain) diff --git a/lua/sim/Entity.lua b/lua/sim/Entity.lua index 9c3498d5d8..d18d8b8cb5 100644 --- a/lua/sim/Entity.lua +++ b/lua/sim/Entity.lua @@ -13,7 +13,7 @@ -- This file gets imported by UI mods sometimes, not sure why. But it prevents -- us from scoping this as an upvalue -- local _c_CreateEntity = _c_CreateEntity - +---@class Entity : moho.entity_methods Entity = Class(moho.entity_methods) { --- Called during class initialisation diff --git a/lua/sim/FactoryBuilderManager.lua b/lua/sim/FactoryBuilderManager.lua index 4ca388ccf8..af09429263 100644 --- a/lua/sim/FactoryBuilderManager.lua +++ b/lua/sim/FactoryBuilderManager.lua @@ -12,6 +12,7 @@ local AIUtils = import('/lua/ai/aiutilities.lua') local Builder = import('/lua/sim/Builder.lua') local AIBuildUnits = import('/lua/ai/aibuildunits.lua') +---@class FactoryBuilderManager : BuilderManager FactoryBuilderManager = Class(BuilderManager) { Create = function(self, brain, lType, location, radius, useCenterPoint) BuilderManager.Create(self,brain) diff --git a/lua/sim/NukeDamage.lua b/lua/sim/NukeDamage.lua index 9aa0e9ace8..6d5b160653 100644 --- a/lua/sim/NukeDamage.lua +++ b/lua/sim/NukeDamage.lua @@ -1,3 +1,4 @@ +---@class NukeAOE NukeAOE = Class() { Damage = false, Radius = false, diff --git a/lua/sim/PlatoonFormManager.lua b/lua/sim/PlatoonFormManager.lua index d41592fece..86f24354b4 100644 --- a/lua/sim/PlatoonFormManager.lua +++ b/lua/sim/PlatoonFormManager.lua @@ -12,6 +12,7 @@ local AIUtils = import('/lua/ai/aiutilities.lua') local Builder = import('/lua/sim/Builder.lua') local AIBuildUnits = import('/lua/ai/aibuildunits.lua') +---@class PlatoonFormManager : BuilderManager PlatoonFormManager = Class(BuilderManager) { Create = function(self, brain, lType, location, radius) BuilderManager.Create(self,brain) diff --git a/lua/sim/Projectile.lua b/lua/sim/Projectile.lua index f63491bf99..5448f053af 100644 --- a/lua/sim/Projectile.lua +++ b/lua/sim/Projectile.lua @@ -72,6 +72,7 @@ local ForkThread = ForkThread local CategoriesDoNotCollide = categories.TORPEDO + categories.MISSILE + categories.DIRECTFIRE local OnImpactDestroyCategories = categories.ANTIMISSILE * categories.ALLPROJECTILES +---@class Projectile : moho.projectile_methods Projectile = Class(moho.projectile_methods) { DestroyOnImpact = true, @@ -771,6 +772,7 @@ Projectile = Class(moho.projectile_methods) { --- A dummy projectile that solely inherits what it needs. Useful for -- effects that require projectiles without additional overhead. +---@class DummyProjectile : moho.projectile_methods DummyProjectile = Class(moho.projectile_methods) { OnCreate = function(self, inWater) diff --git a/lua/sim/Prop.lua b/lua/sim/Prop.lua index 0e82b6ee5c..4d11b1358a 100644 --- a/lua/sim/Prop.lua +++ b/lua/sim/Prop.lua @@ -44,8 +44,10 @@ local StringGsub = string.gsub -- upvalue table functions for performance local TableInsert = table.insert +---@class Prop : moho.prop_methods Prop = Class(moho.prop_methods) { + ---@param self Prop OnCreate = function(self) -- -- Caching @@ -479,4 +481,4 @@ Prop = Class(moho.prop_methods) { return self.CanBeKilled end, -} \ No newline at end of file +} diff --git a/lua/sim/StrategyBuilder.lua b/lua/sim/StrategyBuilder.lua index 673d6eb955..05f6b1e239 100644 --- a/lua/sim/StrategyBuilder.lua +++ b/lua/sim/StrategyBuilder.lua @@ -19,6 +19,7 @@ local Builder = import('/lua/sim/Builder.lua').Builder -- } --} +---@class StrategyBuilder : Builder StrategyBuilder = Class(Builder) { Create = function(self,brain,data,locationType) Builder.Create(self,brain,data,locationType) diff --git a/lua/sim/StrategyManager.lua b/lua/sim/StrategyManager.lua index 5385752290..ae639eb10c 100644 --- a/lua/sim/StrategyManager.lua +++ b/lua/sim/StrategyManager.lua @@ -16,6 +16,7 @@ local AIBuildUnits = import('/lua/ai/aibuildunits.lua') local AIAddBuilderTable = import('/lua/ai/AIAddBuilderTable.lua') local SUtils = import('/lua/AI/sorianutilities.lua') +---@class StrategyManager : BuilderManager StrategyManager = Class(BuilderManager) { Create = function(self, brain, lType, location, radius, useCenterPoint) BuilderManager.Create(self,brain) diff --git a/lua/sim/Unit.lua b/lua/sim/Unit.lua index 1065d8fc83..f1daddb8b3 100644 --- a/lua/sim/Unit.lua +++ b/lua/sim/Unit.lua @@ -115,6 +115,11 @@ local function PopulateBlueprintCache(entity, blueprint) end local cUnit = moho.unit_methods +---@class Unit : moho.unit_methods, moho.entity_methods +---@field Brain AIBrain +---@field Army Army +---@field UnitId UnitId +---@field EntityId EntityId Unit = Class(moho.unit_methods) { Cache = false, @@ -211,6 +216,7 @@ Unit = Class(moho.unit_methods) { } end, + ---@param self Unit OnCreate = function(self) local bp = self:GetBlueprint() @@ -1156,6 +1162,7 @@ Unit = Class(moho.unit_methods) { end, -- On killed: this function plays when the unit takes a mortal hit. Plays death effects and spawns wreckage, dependant on overkill + ---@param self Unit OnKilled = function(self, instigator, type, overkillRatio) local layer = self.Layer self.Dead = true @@ -1276,6 +1283,7 @@ Unit = Class(moho.unit_methods) { end, --- Called when this unit kills another. Chiefly responsible for the veterancy system for now. + ---@param self Unit OnKilledUnit = function(self, unitKilled, massKilled) if not massKilled or massKilled == 0 then return end -- Make sure engine calls aren't passed with massKilled == 0 if IsAlly(self.Army, unitKilled.Army) then return end -- No XP for friendly fire... @@ -2103,6 +2111,7 @@ Unit = Class(moho.unit_methods) { end end, + ---@param self Unit OnStopBeingBuilt = function(self, builder, layer) if self.Dead or self:BeenDestroyed() then -- Sanity check, can prevent strange shield bugs and stuff self:Kill() @@ -4534,6 +4543,7 @@ local UnitGetUnitId = _G.moho.unit_methods.GetUnitId -- upvalued categories for performance local CategoriesDummyUnit = categories.DUMMYUNIT +---@class DummyUnit : moho.unit_methods DummyUnit = Class(moho.unit_methods) { Cache = false, diff --git a/lua/sim/defaultweapons.lua b/lua/sim/defaultweapons.lua index 16d8d9c2b3..caa87b7de0 100644 --- a/lua/sim/defaultweapons.lua +++ b/lua/sim/defaultweapons.lua @@ -10,6 +10,7 @@ local Game = import('/lua/game.lua') local CalculateBallisticAcceleration = import('/lua/sim/CalcBallisticAcceleration.lua').CalculateBallisticAcceleration -- Most weapons derive from this class, including beam weapons later in this file +---@class DefaultProjectileWeapon: Weapon DefaultProjectileWeapon = Class(Weapon) { FxRackChargeMuzzleFlash = {}, @@ -869,6 +870,7 @@ DefaultProjectileWeapon = Class(Weapon) { }, } +---@class KamikazeWeapon : Weapon KamikazeWeapon = Class(Weapon) { OnFire = function(self) local myBlueprint = self.Blueprint @@ -878,6 +880,7 @@ KamikazeWeapon = Class(Weapon) { end, } +---@class BareBonesWeapon : Weapon BareBonesWeapon = Class(Weapon) { Data = {}, @@ -890,6 +893,7 @@ BareBonesWeapon = Class(Weapon) { end, } +---@class OverchargeWeapon : DefaultProjectileWeapon OverchargeWeapon = Class(DefaultProjectileWeapon) { NeedsUpgrade = false, AutoMode = false, @@ -1063,6 +1067,7 @@ OverchargeWeapon = Class(DefaultProjectileWeapon) { } } +---@class DefaultBeamWeapon : DefaultProjectileWeapon DefaultBeamWeapon = Class(DefaultProjectileWeapon) { BeamType = CollisionBeam, @@ -1287,6 +1292,7 @@ DefaultBeamWeapon = Class(DefaultProjectileWeapon) { } local NukeDamage = import('/lua/sim/NukeDamage.lua').NukeAOE +---@class DeathNukeWeapon : BareBonesWeapon DeathNukeWeapon = Class(BareBonesWeapon) { OnFire = function(self) end, @@ -1319,6 +1325,7 @@ DeathNukeWeapon = Class(BareBonesWeapon) { end, } +---@class SCUDeathWeapon : BareBonesWeapon SCUDeathWeapon = Class(BareBonesWeapon) { OnFire = function(self) end, diff --git a/lua/sim/tasks/AttackMove.lua b/lua/sim/tasks/AttackMove.lua index e5c7d64168..df7de3d882 100644 --- a/lua/sim/tasks/AttackMove.lua +++ b/lua/sim/tasks/AttackMove.lua @@ -7,6 +7,7 @@ local ScriptTask = import('/lua/sim/ScriptTask.lua').ScriptTask local TASKSTATUS = import('/lua/sim/ScriptTask.lua').TASKSTATUS local AIRESULT = import('/lua/sim/ScriptTask.lua').AIRESULT +---@class AttackMove : ScriptTask AttackMove = Class(ScriptTask) { TaskTick = function(self) self:SetAIResult(AIRESULT.Success) diff --git a/lua/sim/tasks/EnhanceTask.lua b/lua/sim/tasks/EnhanceTask.lua index 6592fee731..eeb8f03d7b 100644 --- a/lua/sim/tasks/EnhanceTask.lua +++ b/lua/sim/tasks/EnhanceTask.lua @@ -7,6 +7,7 @@ local ScriptTask = import('/lua/sim/ScriptTask.lua').ScriptTask local TASKSTATUS = import('/lua/sim/ScriptTask.lua').TASKSTATUS local AIRESULT = import('/lua/sim/ScriptTask.lua').AIRESULT +---@class EnhanceTask : ScriptTask EnhanceTask = Class(ScriptTask) { OnCreate = function(self,commandData) ScriptTask.OnCreate(self,commandData) diff --git a/lua/sim/tasks/GiveTask.lua b/lua/sim/tasks/GiveTask.lua index 9fd346eec4..329e325815 100644 --- a/lua/sim/tasks/GiveTask.lua +++ b/lua/sim/tasks/GiveTask.lua @@ -5,6 +5,7 @@ local GiveUnitsToPlayer = import('/lua/simutils.lua').GiveUnitsToPlayer local SpawnPing = import('/lua/SimPing.lua').SpawnPing local transferList = {} +---@class GiveTask : ScriptTask GiveTask = Class(ScriptTask) { OnCreate = function(self, commandData) ScriptTask.OnCreate(self, commandData) diff --git a/lua/sim/weapon.lua b/lua/sim/weapon.lua index e0e0b1a160..f737172756 100644 --- a/lua/sim/weapon.lua +++ b/lua/sim/weapon.lua @@ -37,6 +37,7 @@ local function ParsePriorities() return finalPriorities end +---@class Weapon : moho.weapon_methods Weapon = Class(moho.weapon_methods) { __init = function(self, unit) self.unit = unit diff --git a/lua/simInit.lua b/lua/simInit.lua index b3c81f3d67..0bf06623b4 100644 --- a/lua/simInit.lua +++ b/lua/simInit.lua @@ -1,3 +1,4 @@ +---@declare-global -- ========================================================================================== -- * File : lua/simInit.lua -- * Authors : Gas Powered Games, FAF Community, HUSSAR @@ -100,9 +101,9 @@ function SetupSession() end -- LOG('SetupSession: ', repr(ScenarioInfo)) - + ---@type table ArmyBrains = {} - + -- ScenarioInfo is a table filled in by the engine with fields from the _scenario.lua -- file we're using for this game. We use it to store additional global information -- needed by our scenario. diff --git a/lua/system/Blueprints.lua b/lua/system/Blueprints.lua index 83b5ab8947..bc8b8d1587 100644 --- a/lua/system/Blueprints.lua +++ b/lua/system/Blueprints.lua @@ -1,3 +1,4 @@ +---@declare-global -- -- Blueprint loading -- @@ -813,13 +814,13 @@ function PostModBlueprints(all_bps) end ----------------------------------------------------------------------------------------------- --- Loads all blueprints with optional parameters ---- @param pattern - specifies pattern of files to load, defaults to '*.bp' ---- @param directories - specifies table of directory paths to load blueprints from, defaults to all directories ---- @param mods - specifies table of mods to load blueprints from, defaults to active mods ---- @param skipGameFiles - specifies whether skip loading original game files, defaults to false ---- @param skipExtraction - specifies whether skip extraction of meshes, defaults to false ---- @param skipRegistration - specifies whether skip registration of blueprints, defaults to false ---- @param taskNotifier - specifies reference to a notifier that is updating UI when loading blueprints +---@param pattern string - specifies pattern of files to load, defaults to '*.bp' +---@param directories string[]|nil - specifies table of directory paths to load blueprints from, defaults to all directories +---@param mods table - specifies table of mods to load blueprints from, defaults to active mods +---@param skipGameFiles boolean - specifies whether skip loading original game files, defaults to false +---@param skipExtraction boolean - specifies whether skip extraction of meshes, defaults to false +---@param skipRegistration boolean - specifies whether skip registration of blueprints, defaults to false +---@param taskNotifier unknown - specifies reference to a notifier that is updating UI when loading blueprints --- NOTE now it supports loading blueprints on UI-side in addition to loading on Sim-side --- Sim -> LoadBlueprints() - no arguments, no changes! --- UI -> LoadBlueprints('*_unit.bp', {'/units'}, mods, true, true, true, taskNotifier) used in ModsManager.lua diff --git a/lua/system/GlobalBaseTemplate.lua b/lua/system/GlobalBaseTemplate.lua index f960bd1c4e..fb9d16665b 100644 --- a/lua/system/GlobalBaseTemplate.lua +++ b/lua/system/GlobalBaseTemplate.lua @@ -1,10 +1,11 @@ +---@declare-global ---------------------------------------------------------------------------- -- -- File : /lua/system/GlobalBaseTemplate.lua -- -- Summary : Global base table and template methods -- --- Copyright © 2007 Gas Powered Games, Inc. All rights reserved. +-- Copyright � 2007 Gas Powered Games, Inc. All rights reserved. ---------------------------------------------------------------------------- -- Global list of all BaseBuilderTemplates found in the system. diff --git a/lua/system/GlobalBuilderGroup.lua b/lua/system/GlobalBuilderGroup.lua index 7c9bf570ac..ea6aaf1515 100644 --- a/lua/system/GlobalBuilderGroup.lua +++ b/lua/system/GlobalBuilderGroup.lua @@ -1,3 +1,4 @@ +---@declare-global ---------------------------------------------------------------------------- -- -- File : /lua/system/GlobalBuilderGroup.lua diff --git a/lua/system/GlobalBuilderTemplate.lua b/lua/system/GlobalBuilderTemplate.lua index 5a315cc276..d7f64248ae 100644 --- a/lua/system/GlobalBuilderTemplate.lua +++ b/lua/system/GlobalBuilderTemplate.lua @@ -1,10 +1,11 @@ +---@declare-global ---------------------------------------------------------------------------- -- -- File : /lua/system/GlobalBuilderTemplate.lua -- -- Summary : Global builder table and template methods -- --- Copyright © 2007 Gas Powered Games, Inc. All rights reserved. +-- Copyright � 2007 Gas Powered Games, Inc. All rights reserved. ---------------------------------------------------------------------------- -- Global list of all buffs found in the system. diff --git a/lua/system/GlobalPlatoonTemplate.lua b/lua/system/GlobalPlatoonTemplate.lua index 98fdcd409a..a3a107e3a2 100644 --- a/lua/system/GlobalPlatoonTemplate.lua +++ b/lua/system/GlobalPlatoonTemplate.lua @@ -1,10 +1,11 @@ +---@declare-global ---------------------------------------------------------------------------- -- -- File : /lua/system/GlobalPlatoonTemplate.lua -- -- Summary : Global buff table and blueprint methods -- --- Copyright © 2007 Gas Powered Games, Inc. All rights reserved. +-- Copyright � 2007 Gas Powered Games, Inc. All rights reserved. ---------------------------------------------------------------------------- -- Global list of all buffs found in the system. diff --git a/lua/system/Localization.lua b/lua/system/Localization.lua index 947be20d2f..a1bc7c1ef0 100644 --- a/lua/system/Localization.lua +++ b/lua/system/Localization.lua @@ -1,3 +1,4 @@ +---@declare-global local loc_table -- Special tokens that can be included in a loc string via {g Player} etc. The diff --git a/lua/system/blueprints-ai.lua b/lua/system/blueprints-ai.lua index f1f12a734b..a6d5271cd4 100644 --- a/lua/system/blueprints-ai.lua +++ b/lua/system/blueprints-ai.lua @@ -1,4 +1,4 @@ - +---@declare-global -------------------------------------------------------------------------------- -- Supreme Commander mod threat calculator -- Copyright 2018-2022 Sean 'Balthazar' Wheeldon Lua 5.4.2 diff --git a/lua/system/blueprints-lod.lua b/lua/system/blueprints-lod.lua index 077567b02d..aa19e2648a 100644 --- a/lua/system/blueprints-lod.lua +++ b/lua/system/blueprints-lod.lua @@ -1,4 +1,4 @@ - +---@declare-global local MathSqrt = math.sqrt --- Calculates the LODs of a single prop diff --git a/lua/system/blueprints-projectiles.lua b/lua/system/blueprints-projectiles.lua index 21816ce971..2aebf4e884 100644 --- a/lua/system/blueprints-projectiles.lua +++ b/lua/system/blueprints-projectiles.lua @@ -1,4 +1,4 @@ - +---@declare-global -- Origin of tables of a projectile blueprint diff --git a/lua/system/class.lua b/lua/system/class.lua index dff0805175..1751bd6eac 100644 --- a/lua/system/class.lua +++ b/lua/system/class.lua @@ -1,4 +1,4 @@ - +---@declare-global --- Class structure -- Simple class @@ -121,8 +121,15 @@ local function IsSimpleClass(arg) return arg.n == 1 and getmetatable(arg[1]) == emptyMetaTable end +---@class fa-class: table +---@field __init? fun(self, ...) +---@field __post_init? fun(self, ...) + --- Prepares the construction of a state, , referring to the paragraphs of text at the top of this file. local StateIdentifier = 0 +---@generic T: fa-class +---@param ... T +---@return T function State(...) -- arg = { @@ -157,6 +164,10 @@ function State(...) end --- Prepares the construction of a class, referring to the paragraphs of text at the top of this file. +---construct a class +---@generic T: fa-class +---@vararg table? +---@return fun(specs: T): T function Class(...) -- arg = { @@ -190,6 +201,14 @@ function Class(...) end end +---create a simple class which does not inherit from anything +---@generic T +---@param specs T +---@return T +function ClassSimple(specs) + return Class(specs) +end + --- Computes the hierarchy chain of a function: determine the path from the current function back to -- the base instance. Note that this assumes that the base is always called, which is not always the case. local ChainStack = { } @@ -258,6 +277,11 @@ end --- Constructs a class or state, referring to the paragraphs of text at the top of this file. local Seen = { } +---create a class +---@generic Base: table, T:table +---@param bases Base +---@param specs T +---@return T function ConstructClass(bases, specs) -- cache as locals for performance diff --git a/lua/system/import.lua b/lua/system/import.lua index 374a0e16da..4bab5f984b 100644 --- a/lua/system/import.lua +++ b/lua/system/import.lua @@ -1,4 +1,5 @@ -- Copyright © 2005 Gas Powered Games, Inc. All rights reserved. +---@declare-global -- -- Implement import() @@ -37,7 +38,8 @@ local StringSub = string.sub local informDevOfLoad = false --- The global import function used to keep track of modules. --- @param name The path to the module to load. +---@param name string The path to the module to load. +---@return table function import(name) -- attempt to find the module without lowering the string @@ -116,4 +118,4 @@ function dirty_module(name, why) end end -table.insert(__diskwatch, dirty_module) \ No newline at end of file +table.insert(__diskwatch, dirty_module) diff --git a/lua/system/repr.lua b/lua/system/repr.lua index d151afce02..0dba1a8bbd 100644 --- a/lua/system/repr.lua +++ b/lua/system/repr.lua @@ -1,3 +1,4 @@ +---@declare-global -- scope as upvalue for performance local sort = table.sort @@ -401,4 +402,4 @@ function repru(obj, maxwidth, mindepth) else return r2 end -end \ No newline at end of file +end diff --git a/lua/system/trashbag.lua b/lua/system/trashbag.lua index 3d6d3ff86c..ab4230b104 100644 --- a/lua/system/trashbag.lua +++ b/lua/system/trashbag.lua @@ -1,4 +1,4 @@ - +---@declare-global -- TrashBag is a class to help manage objects that need destruction. You add objects to it with Add(). -- When TrashBag:Destroy() is called, it calls Destroy() in turn on all its contained objects. -- @@ -27,7 +27,8 @@ local TableGetn = table.getn local TableEmpty = table.empty -TrashBag = Class { +---@class TrashBag +TrashBag = ClassSimple { -- Tell the garbage collector that we're a weak table for our values. If an element is ready to be collected -- then we're not a reason for it to remain alive. E.g., we don't care if it got cleaned up earlier. diff --git a/lua/system/utils.lua b/lua/system/utils.lua index a3653784f3..b564ba82ad 100644 --- a/lua/system/utils.lua +++ b/lua/system/utils.lua @@ -1,3 +1,4 @@ +---@declare-global -- ========================================================================================== -- * File : lua/system/utils.lua -- * Authors : Gas Powered Games, FAF Community, HUSSAR diff --git a/lua/terranprojectiles.lua b/lua/terranprojectiles.lua index 14f1e38140..deda909f07 100644 --- a/lua/terranprojectiles.lua +++ b/lua/terranprojectiles.lua @@ -44,6 +44,7 @@ TIFMissileNuke = Class(NukeProjectile, SingleBeamProjectile) { FxImpactUnderWater = {}, } +---@class TIFTacticalNuke : EmitterProjectile TIFTacticalNuke = Class(EmitterProjectile) { FxImpactUnit = {}, FxImpactLand = {}, @@ -53,6 +54,7 @@ TIFTacticalNuke = Class(EmitterProjectile) { ---------------------------------------- -- UEF GINSU RAPID PULSE BEAM PROJECTILE ---------------------------------------- +---@class TAAGinsuRapidPulseBeamProjectile : SingleBeamProjectile TAAGinsuRapidPulseBeamProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/laserturret_munition_beam_03_emit.bp', FxImpactUnit = EffectTemplate.TAAGinsuHitUnit, @@ -64,6 +66,7 @@ TAAGinsuRapidPulseBeamProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN AA PROJECTILES -------------------------------------------------------------------------- +---@class TAALightFragmentationProjectile : SingleCompositeEmitterProjectile TAALightFragmentationProjectile = Class(SingleCompositeEmitterProjectile) { BeamName = '/effects/emitters/antiair_munition_beam_01_emit.bp', PolyTrail = '/effects/emitters/default_polytrail_01_emit.bp', @@ -77,6 +80,7 @@ TAALightFragmentationProjectile = Class(SingleCompositeEmitterProjectile) { -------------------------------------------------------------------------- -- TERRAN ANTIMATTER ARTILLERY PROJECTILES -------------------------------------------------------------------------- +---@class TArtilleryAntiMatterProjectile : SinglePolyTrailProjectile TArtilleryAntiMatterProjectile = Class(SinglePolyTrailProjectile) { FxImpactTrajectoryAligned = false, PolyTrail = '/effects/emitters/antimatter_polytrail_01_emit.bp', @@ -90,6 +94,7 @@ TArtilleryAntiMatterProjectile = Class(SinglePolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class TArtilleryAntiMatterProjectile02 : TArtilleryAntiMatterProjectile TArtilleryAntiMatterProjectile02 = Class(TArtilleryAntiMatterProjectile) { PolyTrail = '/effects/emitters/default_polytrail_07_emit.bp', @@ -99,6 +104,7 @@ TArtilleryAntiMatterProjectile02 = Class(TArtilleryAntiMatterProjectile) { FxImpactLand = EffectTemplate.TAntiMatterShellHit02, } +---@class TArtilleryAntiMatterSmallProjectile : TArtilleryAntiMatterProjectile02 TArtilleryAntiMatterSmallProjectile = Class(TArtilleryAntiMatterProjectile02) { FxLandHitScale = 0.5, FxUnitHitScale = 0.5, @@ -108,6 +114,7 @@ TArtilleryAntiMatterSmallProjectile = Class(TArtilleryAntiMatterProjectile02) { -------------------------------------------------------------------------- -- TERRAN ARTILLERY PROJECTILES -------------------------------------------------------------------------- +---@class TArtilleryProjectile : EmitterProjectile TArtilleryProjectile = Class(EmitterProjectile) { FxImpactTrajectoryAligned = false, FxTrails = {'/effects/emitters/mortar_munition_01_emit.bp',}, @@ -115,6 +122,7 @@ TArtilleryProjectile = Class(EmitterProjectile) { FxImpactProp = EffectTemplate.TPlasmaCannonHeavyHitUnit01, FxImpactLand = EffectTemplate.TPlasmaCannonHeavyHit01, } +---@class TArtilleryProjectilePolytrail : SinglePolyTrailProjectile TArtilleryProjectilePolytrail = Class(SinglePolyTrailProjectile) { FxImpactUnit = EffectTemplate.TPlasmaCannonHeavyHitUnit01, FxImpactProp = EffectTemplate.TPlasmaCannonHeavyHitUnit01, @@ -124,6 +132,7 @@ TArtilleryProjectilePolytrail = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- TERRAN SHIP CANNON PROJECTILES -------------------------------------------------------------------------- +---@class TCannonSeaProjectile : SingleBeamProjectile TCannonSeaProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/cannon_munition_ship_beam_01_emit.bp', FxImpactUnderWater = {}, @@ -132,6 +141,7 @@ TCannonSeaProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN TANK CANNON PROJECTILES -------------------------------------------------------------------------- +---@class TCannonTankProjectile : SingleBeamProjectile TCannonTankProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/cannon_munition_tank_beam_01_emit.bp', FxImpactUnderWater = {}, @@ -140,6 +150,7 @@ TCannonTankProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN DEPTH CHARGE PROJECTILES -------------------------------------------------------------------------- +---@class TDepthChargeProjectile : OnWaterEntryEmitterProjectile TDepthChargeProjectile = Class(OnWaterEntryEmitterProjectile) { FxInitial = {}, FxTrails = {'/effects/emitters/torpedo_underwater_wake_01_emit.bp',}, @@ -187,6 +198,7 @@ TDepthChargeProjectile = Class(OnWaterEntryEmitterProjectile) { -------------------------------------------------------------------------- -- TERRAN GAUSS CANNON PROJECTILES -------------------------------------------------------------------------- +---@class TDFGeneralGaussCannonProjectile : MultiPolyTrailProjectile TDFGeneralGaussCannonProjectile = Class(MultiPolyTrailProjectile) { FxTrails = {}, PolyTrails = EffectTemplate.TGaussCannonPolyTrail, @@ -195,12 +207,14 @@ TDFGeneralGaussCannonProjectile = Class(MultiPolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class TDFGaussCannonProjectile : TDFGeneralGaussCannonProjectile TDFGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- (UEB2301) UEF Triad and (UES0103) UEF Frigate and (UES0202) UEF Cruiser and (UEl0201) UEF Striker and (UEL0202) UEF Pillar FxImpactUnit = EffectTemplate.TGaussCannonHitUnit01, FxImpactProp = EffectTemplate.TGaussCannonHitUnit01, FxImpactLand = EffectTemplate.TGaussCannonHitLand01, } +---@class TDFMediumShipGaussCannonProjectile : TDFGeneralGaussCannonProjectile TDFMediumShipGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- (UES0201) UEF Destroyer FxImpactTrajectoryAligned = false, FxImpactUnit = EffectTemplate.TMediumShipGaussCannonHitUnit01, @@ -208,6 +222,7 @@ TDFMediumShipGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- FxImpactLand = EffectTemplate.TMediumShipGaussCannonHit01, } +---@class TDFBigShipGaussCannonProjectile : TDFGeneralGaussCannonProjectile TDFBigShipGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- UES0302 (UEF Battleship) FxImpactTrajectoryAligned = false, FxImpactUnit = EffectTemplate.TShipGaussCannonHitUnit01, @@ -221,6 +236,7 @@ TDFBigShipGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- UE end, } +---@class TDFMediumLandGaussCannonProjectile : TDFGeneralGaussCannonProjectile TDFMediumLandGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- Triad (T2 PD) FxImpactTrajectoryAligned = false, FxImpactUnit = EffectTemplate.TMediumLandGaussCannonHitUnit01, @@ -228,6 +244,7 @@ TDFMediumLandGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- FxImpactLand = EffectTemplate.TMediumLandGaussCannonHit01, } +---@class TDFBigLandGaussCannonProjectile : TDFGeneralGaussCannonProjectile TDFBigLandGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- Fatboy FxImpactTrajectoryAligned = false, FxImpactUnit = EffectTemplate.TBigLandGaussCannonHitUnit01, @@ -238,6 +255,7 @@ TDFBigLandGaussCannonProjectile = Class(TDFGeneralGaussCannonProjectile) { -- Fa -------------------------------------------------------------------------- -- TERRAN HEAVY PLASMA CANNON PROJECTILES -------------------------------------------------------------------------- +---@class THeavyPlasmaCannonProjectile : MultiPolyTrailProjectile THeavyPlasmaCannonProjectile = Class(MultiPolyTrailProjectile) { -- SACU, titan, T3 gunship and T3 transport FxTrails = EffectTemplate.TPlasmaCannonHeavyMunition, RandomPolyTrails = 1, @@ -252,6 +270,7 @@ THeavyPlasmaCannonProjectile = Class(MultiPolyTrailProjectile) { -- SACU, titan, -------------------------------- -- UEF SMALL YIELD NUCLEAR BOMB -------------------------------- +---@class TIFSmallYieldNuclearBombProjectile : EmitterProjectile TIFSmallYieldNuclearBombProjectile = Class(EmitterProjectile) { -- strategic bomber -- FxTrails = {}, -- FxImpactUnit = EffectTemplate.TSmallYieldNuclearBombHit01, @@ -274,6 +293,7 @@ TIFSmallYieldNuclearBombProjectile = Class(EmitterProjectile) { -- strategic bom -------------------------------------------------------------------------- -- TERRAN BOT LASER PROJECTILES -------------------------------------------------------------------------- +---@class TLaserBotProjectile : MultiPolyTrailProjectile TLaserBotProjectile = Class(MultiPolyTrailProjectile) { -- ACU PolyTrails = EffectTemplate.TLaserPolytrail01, PolyTrailOffset = {0,0,0}, @@ -288,6 +308,7 @@ TLaserBotProjectile = Class(MultiPolyTrailProjectile) { -- ACU -------------------------------------------------------------------------- -- TERRAN LASER PROJECTILES -------------------------------------------------------------------------- +---@class TLaserProjectile : SingleBeamProjectile TLaserProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/laserturret_munition_beam_02_emit.bp', FxImpactUnit = EffectTemplate.TLaserHitUnit01, @@ -299,6 +320,7 @@ TLaserProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN MACHINE GUN SHELLS -------------------------------------------------------------------------- +---@class TMachineGunProjectile : SinglePolyTrailProjectile TMachineGunProjectile = Class(SinglePolyTrailProjectile) { PolyTrail = EffectTemplate.TMachineGunPolyTrail, FxTrails = {}, @@ -320,6 +342,7 @@ TMachineGunProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- TERRAN AA MISSILE PROJECTILES - Air Targets -------------------------------------------------------------------------- +---@class TMissileAAProjectile : EmitterProjectile TMissileAAProjectile = Class(EmitterProjectile) { -- Emitter Values FxInitial = {}, @@ -338,6 +361,7 @@ TMissileAAProjectile = Class(EmitterProjectile) { FxImpactUnderWater = {}, } +---@class TAntiNukeInterceptorProjectile : SingleBeamProjectile TAntiNukeInterceptorProjectile = Class(SingleBeamProjectile) { BeamName = '/effects/emitters/missile_exhaust_fire_beam_02_emit.bp', FxTrails = EffectTemplate.TMissileExhaust03, @@ -354,6 +378,7 @@ TAntiNukeInterceptorProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN CRUISE MISSILE PROJECTILES - Surface Targets -------------------------------------------------------------------------- +---@class TMissileCruiseProjectile : SingleBeamProjectile TMissileCruiseProjectile = Class(SingleBeamProjectile) { DestroyOnImpact = false, FxTrails = EffectTemplate.TMissileExhaust02, @@ -366,6 +391,7 @@ TMissileCruiseProjectile = Class(SingleBeamProjectile) { FxImpactUnderWater = {}, } +---@class TMissileCruiseProjectile02 : SingleBeamProjectile TMissileCruiseProjectile02 = Class(SingleBeamProjectile) { FxImpactTrajectoryAligned = false, DestroyOnImpact = false, @@ -382,6 +408,7 @@ TMissileCruiseProjectile02 = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN SUB-LAUNCHED CRUISE MISSILE PROJECTILES -------------------------------------------------------------------------- +---@class TMissileCruiseSubProjectile : SingleBeamProjectile TMissileCruiseSubProjectile = Class(SingleBeamProjectile) { FxExitWaterEmitter = EffectTemplate.TIFCruiseMissileLaunchExitWater, FxTrailOffset = -0.35, @@ -400,6 +427,7 @@ TMissileCruiseSubProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN MISSILE PROJECTILES - General Purpose -------------------------------------------------------------------------- +---@class TMissileProjectile : SingleBeamProjectile TMissileProjectile = Class(SingleBeamProjectile) { FxTrails = {'/effects/emitters/missile_munition_trail_01_emit.bp',}, FxTrailOffset = -1, @@ -414,6 +442,7 @@ TMissileProjectile = Class(SingleBeamProjectile) { -------------------------------------------------------------------------- -- TERRAN NAPALM CARPET BOMB -------------------------------------------------------------------------- +---@class TNapalmCarpetBombProjectile : SinglePolyTrailProjectile TNapalmCarpetBombProjectile = Class(SinglePolyTrailProjectile) { FxTrails = {}, @@ -431,6 +460,7 @@ TNapalmCarpetBombProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- TERRAN HEAVY NAPALM CARPET BOMB -------------------------------------------------------------------------- +---@class TNapalmHvyCarpetBombProjectile : SinglePolyTrailProjectile TNapalmHvyCarpetBombProjectile = Class(SinglePolyTrailProjectile) { FxTrails = {}, @@ -451,6 +481,7 @@ TNapalmHvyCarpetBombProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- TERRAN PLASMA CANNON PROJECTILES -------------------------------------------------------------------------- +---@class TPlasmaCannonProjectile : SinglePolyTrailProjectile TPlasmaCannonProjectile = Class(SinglePolyTrailProjectile) { FxTrails = EffectTemplate.TPlasmaCannonLightMunition, PolyTrailOffset = 0, @@ -463,6 +494,7 @@ TPlasmaCannonProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- TERRAN RAIL GUN PROJECTILES -------------------------------------------------------------------------- +---@class TRailGunProjectile : SinglePolyTrailProjectile TRailGunProjectile = Class(SinglePolyTrailProjectile) { -- FxTrails = {'/effects/emitters/railgun_munition_trail_02_emit.bp' }, PolyTrail = '/effects/emitters/railgun_polytrail_01_emit.bp', @@ -477,6 +509,7 @@ TRailGunProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- TERRAN PHALANX PROJECTILES -------------------------------------------------------------------------- +---@class TShellPhalanxProjectile : MultiPolyTrailProjectile TShellPhalanxProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = EffectTemplate.TPhalanxGunPolyTrails, PolyTrailOffset = EffectTemplate.TPhalanxGunPolyTrailsOffsets, @@ -492,6 +525,7 @@ TShellPhalanxProjectile = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- TERRAN RIOT PROJECTILES -------------------------------------------------------------------------- +---@class TShellRiotProjectile : MultiPolyTrailProjectile TShellRiotProjectile = Class(MultiPolyTrailProjectile) { PolyTrails = EffectTemplate.TRiotGunPolyTrails, PolyTrailOffset = EffectTemplate.TRiotGunPolyTrailsOffsets, @@ -503,6 +537,7 @@ TShellRiotProjectile = Class(MultiPolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class TShellRiotProjectileLand : MultiPolyTrailProjectile TShellRiotProjectileLand = Class(MultiPolyTrailProjectile) { PolyTrails = EffectTemplate.TRiotGunPolyTrailsTank, PolyTrailOffset = EffectTemplate.TRiotGunPolyTrailsOffsets, @@ -514,6 +549,7 @@ TShellRiotProjectileLand = Class(MultiPolyTrailProjectile) { FxImpactUnderWater = {}, } +---@class TShellRiotProjectileLand02 : TShellRiotProjectileLand TShellRiotProjectileLand02 = Class(TShellRiotProjectileLand) { PolyTrails = EffectTemplate.TRiotGunPolyTrailsEngineer, } @@ -521,6 +557,7 @@ TShellRiotProjectileLand02 = Class(TShellRiotProjectileLand) { -------------------------------------------------------------------------- -- TERRAN ABOVE WATER LAUNCHED TORPEDO -------------------------------------------------------------------------- +---@class TTorpedoShipProjectile : OnWaterEntryEmitterProjectile TTorpedoShipProjectile = Class(OnWaterEntryEmitterProjectile) { FxInitial = {}, FxTrails = {'/effects/emitters/torpedo_underwater_wake_01_emit.bp',}, @@ -565,6 +602,7 @@ TTorpedoShipProjectile = Class(OnWaterEntryEmitterProjectile) { -------------------------------------------------------------------------- -- TERRAN SUB LAUNCHED TORPEDO -------------------------------------------------------------------------- +---@class TTorpedoSubProjectile : EmitterProjectile TTorpedoSubProjectile = Class(EmitterProjectile) { FxTrails = {'/effects/emitters/torpedo_munition_trail_01_emit.bp',}, FxImpactLand = {}, @@ -582,6 +620,7 @@ TTorpedoSubProjectile = Class(EmitterProjectile) { -------------------------------------------------------------------------- -- SC1X UEF BASE TEMPRORARY PROJECTILE -------------------------------------------------------------------------- +---@class TBaseTempProjectile : SinglePolyTrailProjectile TBaseTempProjectile = Class(SinglePolyTrailProjectile) { FxImpactLand = EffectTemplate.AMissileHit01, FxImpactNone = EffectTemplate.AMissileHit01, @@ -600,6 +639,7 @@ TBaseTempProjectile = Class(SinglePolyTrailProjectile) { -------------------------------------------------------------------------- -- UEF PLASMA GATLING CANNON PROJECTILE -------------------------------------------------------------------------- +---@class TGatlingPlasmaCannonProjectile : MultiPolyTrailProjectile TGatlingPlasmaCannonProjectile = Class(MultiPolyTrailProjectile) { PolyTrailOffset = EffectTemplate.TPlasmaGatlingCannonPolyTrailsOffsets, FxImpactNone = EffectTemplate.TPlasmaGatlingCannonUnitHit, @@ -617,6 +657,7 @@ TGatlingPlasmaCannonProjectile = Class(MultiPolyTrailProjectile) { -------------------------------------------------------------------------- -- UEF IONIZED PLASMA GATLING CANNON PROJECTILE -------------------------------------------------------------------------- +---@class TIonizedPlasmaGatlingCannon : SinglePolyTrailProjectile TIonizedPlasmaGatlingCannon = Class(SinglePolyTrailProjectile) { -- percival FxImpactWater = EffectTemplate.TIonizedPlasmaGatlingCannonHit, FxImpactLand = EffectTemplate.TIonizedPlasmaGatlingCannonHit, @@ -633,6 +674,7 @@ TIonizedPlasmaGatlingCannon = Class(SinglePolyTrailProjectile) { -- percival -------------------------------------------------------------------------- -- UEF HEAVY PLASMA GATLING CANNON PROJECTILE -------------------------------------------------------------------------- +---@class THeavyPlasmaGatlingCannon : SinglePolyTrailProjectile THeavyPlasmaGatlingCannon = Class(SinglePolyTrailProjectile) { -- ravager FxImpactTrajectoryAligned = false, FxImpactUnit = EffectTemplate.THeavyPlasmaGatlingCannonHit, @@ -646,6 +688,7 @@ THeavyPlasmaGatlingCannon = Class(SinglePolyTrailProjectile) { -- ravager -- this used to be the tri barelled hiro cannon. +---@class THiroLaser : SinglePolyTrailProjectile THiroLaser = Class(SinglePolyTrailProjectile) { FxTrailOffset = 0, diff --git a/lua/terranunits.lua b/lua/terranunits.lua index 814b13f5d0..7b749c46b8 100644 --- a/lua/terranunits.lua +++ b/lua/terranunits.lua @@ -47,6 +47,7 @@ local CreateUEFBuildSliceBeams = EffectUtil.CreateUEFBuildSliceBeams -------------------------------------------------------------- -- AIR FACTORY STRUCTURES -------------------------------------------------------------- +---@class TAirFactoryUnit : AirFactoryUnit TAirFactoryUnit = Class(AirFactoryUnit) { CreateBuildEffects = function(self, unitBeingBuilt, order) WaitSeconds(0.1) @@ -105,21 +106,25 @@ TAirFactoryUnit = Class(AirFactoryUnit) { -------------------------------------------------------------- -- AIR STAGING STRUCTURES -------------------------------------------------------------- +---@class TAirStagingPlatformUnit : AirStagingPlatformUnit TAirStagingPlatformUnit = Class(AirStagingPlatformUnit) {} -------------------------------------------------------------- -- AIR UNITS -------------------------------------------------------------- +---@class TAirUnit : AirUnit TAirUnit = Class(AirUnit) {} -------------------------------------------------------------- -- WALL STRUCTURES -------------------------------------------------------------- +---@class TConcreteStructureUnit : ConcreteStructureUnit TConcreteStructureUnit = Class(ConcreteStructureUnit) {} -------------------------------------------------------------- -- Construction Units -------------------------------------------------------------- +---@class TConstructionUnit : ConstructionUnit TConstructionUnit = Class(ConstructionUnit) { CreateBuildEffects = function(self, unitBeingBuilt, order) -- Different effect if we have building cube @@ -165,21 +170,25 @@ TConstructionUnit = Class(ConstructionUnit) { -------------------------------------------------------------- -- ENERGY CREATION STRUCTURES -------------------------------------------------------------- +---@class TEnergyCreationUnit : EnergyCreationUnit TEnergyCreationUnit = Class(EnergyCreationUnit) {} -------------------------------------------------------------- -- ENERGY STORAGE STRUCTURES -------------------------------------------------------------- +---@class TEnergyStorageUnit : EnergyStorageUnit TEnergyStorageUnit = Class(EnergyStorageUnit) {} -------------------------------------------------------------- -- HOVER LAND UNITS -------------------------------------------------------------- +---@class THoverLandUnit : HoverLandUnit THoverLandUnit = Class(HoverLandUnit) {} -------------------------------------------------------------- -- LAND FACTORY STRUCTURES -------------------------------------------------------------- +---@class TLandFactoryUnit : LandFactoryUnit TLandFactoryUnit = Class(LandFactoryUnit) { CreateBuildEffects = function(self, unitBeingBuilt, order) WaitSeconds(0.1) @@ -193,26 +202,31 @@ TLandFactoryUnit = Class(LandFactoryUnit) { -------------------------------------------------------------- -- LAND UNITS -------------------------------------------------------------- +---@class TLandUnit : LandUnit TLandUnit = Class(LandUnit) {} -------------------------------------------------------------- -- MASS COLLECTION UNITS -------------------------------------------------------------- +---@class TMassCollectionUnit : MassCollectionUnit TMassCollectionUnit = Class(MassCollectionUnit) {} -------------------------------------------------------------- -- MASS FABRICATION STRUCTURES -------------------------------------------------------------- +---@class TMassFabricationUnit : MassFabricationUnit TMassFabricationUnit = Class(MassFabricationUnit) {} -------------------------------------------------------------- -- MASS STORAGE STRUCTURES -------------------------------------------------------------- +---@class TMassStorageUnit : MassStorageUnit TMassStorageUnit = Class(MassStorageUnit) {} -------------------------------------------------------------- -- MOBILE FACTORY UNIT -------------------------------------------------------------- +---@class TMobileFactoryUnit : AmphibiousLandUnit TMobileFactoryUnit = Class(AmphibiousLandUnit) { StartBeingBuiltEffects = function(self, builder, layer) self:SetMesh(self:GetBlueprint().Display.BuildMeshBlueprint, true) @@ -226,16 +240,19 @@ TMobileFactoryUnit = Class(AmphibiousLandUnit) { -------------------------------------------------------------- -- RADAR STRUCTURES -------------------------------------------------------------- +---@class TRadarUnit : RadarUnit TRadarUnit = Class(RadarUnit) {} -------------------------------------------------------------- -- SONAR STRUCTURES -------------------------------------------------------------- +---@class TSonarUnit : SonarUnit TSonarUnit = Class(SonarUnit) {} -------------------------------------------------------------- -- SEA FACTORY STRUCTURES -------------------------------------------------------------- +---@class TSeaFactoryUnit : SeaFactoryUnit TSeaFactoryUnit = Class(SeaFactoryUnit) { CreateBuildEffects = function(self, unitBeingBuilt, order) WaitSeconds(0.1) @@ -294,23 +311,28 @@ TSeaFactoryUnit = Class(SeaFactoryUnit) { -------------------------------------------------------------- -- SEA UNITS -------------------------------------------------------------- +---@class TSeaUnit : SeaUnit TSeaUnit = Class(SeaUnit) {} -------------------------------------------------------------- -- SHIELD LAND UNITS -------------------------------------------------------------- +---@class TShieldLandUnit : ShieldLandUnit TShieldLandUnit = Class(ShieldLandUnit) {} -------------------------------------------------------------- -- SHIELD STRUCTURES -------------------------------------------------------------- +---@class TShieldStructureUnit : ShieldStructureUnit TShieldStructureUnit = Class(ShieldStructureUnit) {} -------------------------------------------------------------- -- STRUCTURES -------------------------------------------------------------- +---@class TStructureUnit : StructureUnit TStructureUnit = Class(StructureUnit) {} +---@class TRadarJammerUnit : RadarJammerUnit TRadarJammerUnit = Class(RadarJammerUnit) { OnIntelEnabled = function(self) if not self.MySpinner then @@ -330,41 +352,49 @@ TRadarJammerUnit = Class(RadarJammerUnit) { -------------------------------------------------------------- -- SUBMARINE UNITS -------------------------------------------------------------- +---@class TSubUnit : SubUnit TSubUnit = Class(SubUnit) {} -------------------------------------------------------------- -- TRANSPORT BEACON UNITS -------------------------------------------------------------- +---@class TTransportBeaconUnit : TransportBeaconUnit TTransportBeaconUnit = Class(TransportBeaconUnit) {} -------------------------------------------------------------- -- WALKING LAND UNITS -------------------------------------------------------------- +---@class TWalkingLandUnit : WalkingLandUnit TWalkingLandUnit = Class(WalkingLandUnit) { } -------------------------------------------------------------- -- WALL STRUCTURES -------------------------------------------------------------- +---@class TWallStructureUnit : WallStructureUnit TWallStructureUnit = Class(WallStructureUnit) {} -------------------------------------------------------------- -- CIVILIAN STRUCTURES -------------------------------------------------------------- +---@class TCivilianStructureUnit : StructureUnit TCivilianStructureUnit = Class(StructureUnit) {} -------------------------------------------------------------- -- QUANTUM GATE UNITS -------------------------------------------------------------- +---@class TQuantumGateUnit : QuantumGateUnit TQuantumGateUnit = Class(QuantumGateUnit) {} -------------------------------------------------------------- -- SHIELD SEA UNITS -------------------------------------------------------------- +---@class TShieldSeaUnit : ShieldSeaUnit TShieldSeaUnit = Class(ShieldSeaUnit) {} -------------------------------------------------------------- -- Pod Tower Unit (Kennels) -------------------------------------------------------------- +---@class TPodTowerUnit : TStructureUnit TPodTowerUnit = Class(TStructureUnit) { OnStopBeingBuilt = function(self, builder, layer) TStructureUnit.OnStopBeingBuilt(self, builder, layer) diff --git a/lua/terranweapons.lua b/lua/terranweapons.lua index eaf5f0af82..486e69e75e 100644 --- a/lua/terranweapons.lua +++ b/lua/terranweapons.lua @@ -21,35 +21,43 @@ TDFFragmentationGrenadeLauncherWeapon= Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.THeavyFragmentationGrenadeMuzzleFlash, } +---@class TDFPlasmaCannonWeapon : DefaultProjectileWeapon TDFPlasmaCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TPlasmaGatlingCannonMuzzleFlash, } +---@class TIFFragLauncherWeapon : DefaultProjectileWeapon TIFFragLauncherWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TPlasmaCannonHeavyMuzzleFlash, } +---@class TDFHeavyPlasmaGatlingWeapon : DefaultProjectileWeapon TDFHeavyPlasmaGatlingWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TPlasmaCannonHeavyMuzzleFlash, } +---@class TDFLightPlasmaCannonWeapon : DefaultProjectileWeapon TDFLightPlasmaCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TPlasmaCannonLightMuzzleFlash, } +---@class TDFHeavyPlasmaCannonWeapon : DefaultProjectileWeapon TDFHeavyPlasmaCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TPlasmaCannonHeavyMuzzleFlash, } +---@class TDFHeavyPlasmaGatlingCannonWeapon : DefaultProjectileWeapon TDFHeavyPlasmaGatlingCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.THeavyPlasmaGatlingCannonMuzzleFlash, } +---@class TDFOverchargeWeapon : OverchargeWeapon TDFOverchargeWeapon = Class(WeaponFile.OverchargeWeapon) { FxMuzzleFlash = EffectTemplate.TCommanderOverchargeFlash01, DesiredWeaponLabel = 'RightZephyr' } +---@class TDFMachineGunWeapon : DefaultProjectileWeapon TDFMachineGunWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/machinegun_muzzle_fire_01_emit.bp', @@ -57,34 +65,42 @@ TDFMachineGunWeapon = Class(DefaultProjectileWeapon) { }, } +---@class TDFGaussCannonWeapon : DefaultProjectileWeapon TDFGaussCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TGaussCannonFlash, } +---@class TDFShipGaussCannonWeapon : DefaultProjectileWeapon TDFShipGaussCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TShipGaussCannonFlash, } +---@class TDFLandGaussCannonWeapon : DefaultProjectileWeapon TDFLandGaussCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TLandGaussCannonFlash, } +---@class TDFZephyrCannonWeapon : DefaultProjectileWeapon TDFZephyrCannonWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TLaserMuzzleFlash, } +---@class TDFRiotWeapon : DefaultProjectileWeapon TDFRiotWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TRiotGunMuzzleFx, } +---@class TAAGinsuRapidPulseWeapon : DefaultProjectileWeapon TAAGinsuRapidPulseWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {}, } +---@class TDFIonizedPlasmaCannon : DefaultProjectileWeapon TDFIonizedPlasmaCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TIonizedPlasmaGatlingCannonMuzzleFlash, } +---@class TDFHiroPlasmaCannon : DefaultBeamWeapon TDFHiroPlasmaCannon = Class(DefaultBeamWeapon) { BeamType = CollisionBeams.TDFHiroCollisionBeam, FxMuzzleFlash = {}, @@ -105,6 +121,7 @@ TDFHiroPlasmaCannon = Class(DefaultBeamWeapon) { end, } +---@class TAAFlakArtilleryCannon : DefaultProjectileWeapon TAAFlakArtilleryCannon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TFlakCannonMuzzleFlash01, -- Custom over-ride for this weapon, so it passes data and damageTable @@ -131,30 +148,37 @@ TAAFlakArtilleryCannon = Class(DefaultProjectileWeapon) { end } +---@class TAALinkedRailgun : DefaultProjectileWeapon TAALinkedRailgun = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TRailGunMuzzleFlash01, } +---@class TAirToAirLinkedRailgun : DefaultProjectileWeapon TAirToAirLinkedRailgun = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TRailGunMuzzleFlash02, } +---@class TIFCruiseMissileUnpackingLauncher : DefaultProjectileWeapon TIFCruiseMissileUnpackingLauncher = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {}, } +---@class TIFCruiseMissileLauncher : DefaultProjectileWeapon TIFCruiseMissileLauncher = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TIFCruiseMissileLaunchSmoke, } +---@class TIFCruiseMissileLauncherSub : DefaultProjectileWeapon TIFCruiseMissileLauncherSub = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TIFCruiseMissileLaunchUnderWater, } +---@class TSAMLauncher : DefaultProjectileWeapon TSAMLauncher = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TAAMissileLaunch, } +---@class TANTorpedoLandWeapon : DefaultProjectileWeapon TANTorpedoLandWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/default_muzzle_flash_01_emit.bp', @@ -163,6 +187,7 @@ TANTorpedoLandWeapon = Class(DefaultProjectileWeapon) { }, } +---@class TANTorpedoAngler : DefaultProjectileWeapon TANTorpedoAngler = Class(DefaultProjectileWeapon) { FxMuzzleFlash = { '/effects/emitters/default_muzzle_flash_01_emit.bp', @@ -171,6 +196,7 @@ TANTorpedoAngler = Class(DefaultProjectileWeapon) { }, } +---@class TIFSmartCharge : DefaultProjectileWeapon TIFSmartCharge = Class(DefaultProjectileWeapon) { CreateProjectileAtMuzzle = function(self, muzzle) local proj = DefaultProjectileWeapon.CreateProjectileAtMuzzle(self, muzzle) @@ -179,12 +205,15 @@ TIFSmartCharge = Class(DefaultProjectileWeapon) { end, } +---@class TIFStrategicMissileWeapon : DefaultProjectileWeapon TIFStrategicMissileWeapon = Class(DefaultProjectileWeapon) {} +---@class TIFArtilleryWeapon : DefaultProjectileWeapon TIFArtilleryWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TIFArtilleryMuzzleFlash } +---@class TIFCarpetBombWeapon : DefaultProjectileWeapon TIFCarpetBombWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_02_emit.bp',}, @@ -222,18 +251,22 @@ TIFCarpetBombWeapon = Class(DefaultProjectileWeapon) { end, } +---@class TIFSmallYieldNuclearBombWeapon : DefaultProjectileWeapon TIFSmallYieldNuclearBombWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/antiair_muzzle_fire_02_emit.bp',}, } +---@class TIFHighBallisticMortarWeapon : DefaultProjectileWeapon TIFHighBallisticMortarWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TMobileMortarMuzzleEffect01, } +---@class TAMInterceptorWeapon : DefaultProjectileWeapon TAMInterceptorWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = {'/effects/emitters/terran_antinuke_launch_01_emit.bp',}, } +---@class TAMPhalanxWeapon : DefaultProjectileWeapon TAMPhalanxWeapon = Class(DefaultProjectileWeapon) { FxMuzzleFlash = EffectTemplate.TPhalanxGunMuzzleFlash, FxShellEject = EffectTemplate.TPhalanxGunShells, @@ -246,6 +279,7 @@ TAMPhalanxWeapon = Class(DefaultProjectileWeapon) { end, } +---@class TOrbitalDeathLaserBeamWeapon : DefaultBeamWeapon TOrbitalDeathLaserBeamWeapon = Class(DefaultBeamWeapon) { BeamType = OrbitalDeathLaserCollisionBeam, FxUpackingChargeEffects = {}, diff --git a/lua/ui/controls/acubutton.lua b/lua/ui/controls/acubutton.lua index 04a7dc88df..d9729119c4 100644 --- a/lua/ui/controls/acubutton.lua +++ b/lua/ui/controls/acubutton.lua @@ -19,6 +19,7 @@ local teamIcons = { --- A small button representing an ACU, with support for showing colour and team affiliation, with -- an exciting pulsating blue mouse-over effect. +---@class ACUButton : Group ACUButton = Class(Group) { __init = function(self, parent, enabled) Group.__init(self, parent) diff --git a/lua/ui/controls/border.lua b/lua/ui/controls/border.lua index baa7f630c4..6ad4dd1c59 100644 --- a/lua/ui/controls/border.lua +++ b/lua/ui/controls/border.lua @@ -1,6 +1,7 @@ local NinePatch = import('/lua/ui/controls/ninepatch.lua').NinePatch -- A nine-patch without a background, useful for laying out around things. An eight-patch. +---@class Border : NinePatch Border = Class(NinePatch) { __init = function(self, parent, topLeft, topRight, bottomLeft, bottomRight, left, right, top, bottom) NinePatch.__init(self, parent, nil, topLeft, topRight, bottomLeft, bottomRight, left, right, top, bottom) diff --git a/lua/ui/controls/checkbox.lua b/lua/ui/controls/checkbox.lua index fb00f0a278..cf5ec0f883 100644 --- a/lua/ui/controls/checkbox.lua +++ b/lua/ui/controls/checkbox.lua @@ -3,6 +3,7 @@ local UIUtil = import('/lua/ui/uiutil.lua') local LayoutHelpers = import('/lua/maui/layouthelpers.lua') local Group = import('/lua/maui/group.lua').Group +---@class Checkbox : Group Checkbox = Class(Group) { __init = function(self, parent, normalUnchecked, normalChecked, overUnchecked, overChecked, disabledUnchecked, disabledChecked, label, labelRight, labelSize, clickCue, rolloverCue) Group.__init(self, parent) diff --git a/lua/ui/controls/columnlayout.lua b/lua/ui/controls/columnlayout.lua index 8e4c9b4bdb..c75bdab5b1 100644 --- a/lua/ui/controls/columnlayout.lua +++ b/lua/ui/controls/columnlayout.lua @@ -2,6 +2,7 @@ local LayoutHelpers = import('/lua/maui/layouthelpers.lua') local Group = import('/lua/maui/group.lua').Group --- A Group for arranging controls horizontally in fixed-width columns. +---@class ColumnLayout : Group ColumnLayout = Class(Group) { --- Create a new ColumnLayout -- diff --git a/lua/ui/controls/combo.lua b/lua/ui/controls/combo.lua index d488c904ed..564dc07b63 100644 --- a/lua/ui/controls/combo.lua +++ b/lua/ui/controls/combo.lua @@ -51,6 +51,7 @@ local defaultBitmaps = { ---------------------------------------------------------------------------------------------------------------------------------------- COMBO +---@class Combo : Group Combo = Class(Group) { __init = function(self, parent, pointSize, maxVisibleItems, staticTitle, bitmaps, rolloverCue, clickCue, itemCue, debugName, EnableColor) Group.__init(self, parent) @@ -409,6 +410,7 @@ Combo = Class(Group) { -- This combo is used when you have a few bitmaps you want to choose between, no scrollbar. -- NOTE: At some point a flexible control combo that uses grid should be made so anything can be in it -- bitmap array expects an array of bitmap names or colors +---@class BitmapCombo : Group BitmapCombo = Class(Group) { __init = function(self, parent, bitmapArray, defaultIndex, isColor, bitmaps, rolloverCue, clickCue, debugName) Group.__init(self, parent) diff --git a/lua/ui/controls/filepicker.lua b/lua/ui/controls/filepicker.lua index 2fdf5183be..ef4a9fb8e8 100644 --- a/lua/ui/controls/filepicker.lua +++ b/lua/ui/controls/filepicker.lua @@ -137,6 +137,7 @@ function IsFilenameInvalid(filename) return nil end +---@class FilePicker : Group FilePicker = Class(Group) { __init = function(self, parent, fileType, onlyShowMine, selectAction, debugName) Group.__init(self, parent) diff --git a/lua/ui/controls/ninepatch.lua b/lua/ui/controls/ninepatch.lua index f6374f1b92..2c81e6dd44 100644 --- a/lua/ui/controls/ninepatch.lua +++ b/lua/ui/controls/ninepatch.lua @@ -2,6 +2,7 @@ local Group = import('/lua/maui/group.lua').Group local Bitmap = import('/lua/maui/bitmap.lua').Bitmap local ScaleNumber = import('/lua/maui/layouthelpers.lua').ScaleNumber +---@class NinePatch : Group NinePatch = Class(Group) { __init = function(self, parent, center, topLeft, topRight, bottomLeft, bottomRight, left, right, top, bottom) Group.__init(self, parent) diff --git a/lua/ui/controls/popups/inputdialog.lua b/lua/ui/controls/popups/inputdialog.lua index eba274617a..4270ec58e9 100644 --- a/lua/ui/controls/popups/inputdialog.lua +++ b/lua/ui/controls/popups/inputdialog.lua @@ -5,6 +5,7 @@ local Edit = import('/lua/maui/edit.lua').Edit local Popup = import('/lua/ui/controls/popups/popup.lua').Popup --- A popup that asks the user for a string. +---@class InputDialog : Popup InputDialog = Class(Popup) { __init = function(self, parent, title, fallbackInputbox, str) -- For ridiculous reasons, the lobby *must* keep keyboard focus on the chat input, or diff --git a/lua/ui/controls/popups/popup.lua b/lua/ui/controls/popups/popup.lua index d3c41eb363..c33ec2eb3b 100644 --- a/lua/ui/controls/popups/popup.lua +++ b/lua/ui/controls/popups/popup.lua @@ -7,6 +7,7 @@ local EscapeHandler = import('/lua/ui/dialogs/eschandler.lua') --- Base class for popups. A popup appears on top of other UI content, darkens the content behind it, -- and draws a standard background behind its content. You'll probably want to extend it to do -- something more involved, or use it as-is if you want to manually assemble your popup UI Group. +---@class Popup : Group Popup = Class(Group) { --- Create a new popup -- diff --git a/lua/ui/controls/radiobutton.lua b/lua/ui/controls/radiobutton.lua index 0cdf87af62..3b7917df2c 100644 --- a/lua/ui/controls/radiobutton.lua +++ b/lua/ui/controls/radiobutton.lua @@ -3,6 +3,7 @@ local UIUtil = import('/lua/ui/uiutil.lua') local LayoutHelpers = import('/lua/maui/layouthelpers.lua') local Tooltip = import('/lua/ui/game/tooltip.lua') +---@class RadioButton : Group RadioButton = Class(Group) { -- title: A string displayed above the group. If nil, no textfield is created. -- buttons: A table of tables describing buttons. Only one key is required: diff --git a/lua/ui/controls/resmappreview.lua b/lua/ui/controls/resmappreview.lua index 7a79fa67bc..dc3f065e9b 100644 --- a/lua/ui/controls/resmappreview.lua +++ b/lua/ui/controls/resmappreview.lua @@ -12,6 +12,7 @@ local DEFAULT_HYDROCARBON_ICON_SIZE = 14 local DEFAULT_MASS_ICON_SIZE = 10 --- UI control to show a preview image of a map, with optional resource markers. +---@class ResourceMapPreview : Group ResourceMapPreview = Class(Group) { __init = function(self, parent, size, massIconSize, hydroIconSize, buttonsDisabled) Group.__init(self, parent) diff --git a/lua/ui/controls/textarea.lua b/lua/ui/controls/textarea.lua index 9b68e1775a..cb1acfe511 100644 --- a/lua/ui/controls/textarea.lua +++ b/lua/ui/controls/textarea.lua @@ -14,6 +14,7 @@ local ScaleNumber = import('/lua/maui/layouthelpers.lua').ScaleNumber -- incurred from having to layout a ton of TextFields is absent, we merely have to stave off the -- self-harm long enough to finish writing this class so we can call this a solved problem and never -- look in this file ever again. +---@class TextArea : ItemList TextArea = Class(ItemList) { __init = function(self, parent, width, height) ItemList.__init(self, parent) diff --git a/lua/ui/controls/togglebutton.lua b/lua/ui/controls/togglebutton.lua index c28cb5b68e..a914b38ad6 100644 --- a/lua/ui/controls/togglebutton.lua +++ b/lua/ui/controls/togglebutton.lua @@ -6,6 +6,7 @@ local Tooltip = import('/lua/ui/game/tooltip.lua') --- Represents a button with multiple states. -- A ToggleButton is a button that, when clicked, moves to the next state (or back to the first state -- if the end of the state list has been reached) and dispatches an event. +---@class ToggleButton : Group ToggleButton = Class(Group) { --- Create a new ToggleButton -- diff --git a/lua/ui/controls/worldview.lua b/lua/ui/controls/worldview.lua index 7f4218d256..c3dfe387e5 100644 --- a/lua/ui/controls/worldview.lua +++ b/lua/ui/controls/worldview.lua @@ -147,6 +147,7 @@ DecalFunctions = { RULEUCC_Overcharge = OverchargeDecalFunc } +---@class WorldView : moho.UIWorldView, Control WorldView = Class(moho.UIWorldView, Control) { Cursor = nil, diff --git a/lua/ui/game/Profiler.lua b/lua/ui/game/Profiler.lua index 305081a5b6..6618a53488 100644 --- a/lua/ui/game/Profiler.lua +++ b/lua/ui/game/Profiler.lua @@ -205,6 +205,7 @@ function CloseWindow() end end +---@class ProfilerWindow : Window ProfilerWindow = Class(Window) { __init = function(self, parent) Window.__init(self, parent, "Profiler", false, false, false, true, false, "profiler2", { diff --git a/lua/ui/game/ProfilerElements.lua b/lua/ui/game/ProfilerElements.lua index c17c808fcc..f48794c8b1 100644 --- a/lua/ui/game/ProfilerElements.lua +++ b/lua/ui/game/ProfilerElements.lua @@ -114,6 +114,7 @@ function DepopulateDefaultElement(element) end) end +---@class ProfilerScrollArea : Group ProfilerScrollArea = Class(Group) { __init = function(self, parent) Group.__init(self, parent) diff --git a/lua/ui/game/reclaim.lua b/lua/ui/game/reclaim.lua index 4e562bd480..8a8e926e39 100644 --- a/lua/ui/game/reclaim.lua +++ b/lua/ui/game/reclaim.lua @@ -83,7 +83,7 @@ function InPlayableArea(pos) end return true end - +---@class WorldLabel : Group local WorldLabel = Class(Group) { __init = function(self, parent, position) Group.__init(self, parent) diff --git a/lua/ui/game/score-alt.lua b/lua/ui/game/score-alt.lua new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lua/ui/lobby/autolobby-classes.lua b/lua/ui/lobby/autolobby-classes.lua index 2fd3b01e9d..2222d0dc95 100644 --- a/lua/ui/lobby/autolobby-classes.lua +++ b/lua/ui/lobby/autolobby-classes.lua @@ -9,6 +9,7 @@ local MathMax = math.max local MathMin = math.min --- A small UI component created according to the Model / View / Controller (MVC) principle +---@class ConnectionStatus : Group ConnectionStatus = Class(Group) { -- Initialisation diff --git a/lua/ui/lobby/changelog.lua b/lua/ui/lobby/changelog.lua index cd81a1ef39..718e20f8bd 100644 --- a/lua/ui/lobby/changelog.lua +++ b/lua/ui/lobby/changelog.lua @@ -25,6 +25,7 @@ local debugInterface = false -- from working :sad: isOpen = false +---@class Changelog : Group Changelog = Class(Group) { __init = function(self, parent) diff --git a/lua/ui/lobby/chatarea.lua b/lua/ui/lobby/chatarea.lua index b292f25323..7a904787fb 100644 --- a/lua/ui/lobby/chatarea.lua +++ b/lua/ui/lobby/chatarea.lua @@ -25,6 +25,7 @@ local defaultStyle = { } } +---@class ChatArea : Group ChatArea = Class(Group) { __init = function(self, parent, width, height) diff --git a/lua/ui/lobby/data/playerdata.lua b/lua/ui/lobby/data/playerdata.lua index b40d5a5816..492ee53559 100644 --- a/lua/ui/lobby/data/playerdata.lua +++ b/lua/ui/lobby/data/playerdata.lua @@ -29,6 +29,7 @@ local DEFAULT_MAPPING = { } -- Represents player data using the magic of lazy variables. +---@class PlayerData : WatchedValueTable PlayerData = Class(WatchedValueTable) { -- Create a new PlayerData object for the given player name. __init = function(self, initialMapping) diff --git a/lua/ui/lobby/data/watchedvalue/watchedvaluearray.lua b/lua/ui/lobby/data/watchedvalue/watchedvaluearray.lua index 6563b1a0a3..4d3124f307 100644 --- a/lua/ui/lobby/data/watchedvalue/watchedvaluearray.lua +++ b/lua/ui/lobby/data/watchedvalue/watchedvaluearray.lua @@ -2,6 +2,7 @@ local WatchedValueTable = import('/lua/ui/lobby/data/watchedvalue/watchedvalueta --- A WatchedValueTable with integral keys. Note that `false` is indistinguishable from `nil` in this -- structure, because Lua. +---@class WatchedValueArray : WatchedValueTable WatchedValueArray = Class(WatchedValueTable) { __init = function(self, size) local initialMapping = {} diff --git a/lua/ui/lobby/data/watchedvalue/watchedvaluetable.lua b/lua/ui/lobby/data/watchedvalue/watchedvaluetable.lua index 896850ab5b..293b50847f 100644 --- a/lua/ui/lobby/data/watchedvalue/watchedvaluetable.lua +++ b/lua/ui/lobby/data/watchedvalue/watchedvaluetable.lua @@ -24,6 +24,7 @@ LoggingEnabled = false LoggedChanges = {} -- A flat, fixed-keyset table eagerly populated with WatchedValues. +---@class WatchedValueTable : WatchedValueTable = Class() { __init = function(self, initialMapping) -- Where the values are really stored (__index and friends only apply if the keys are absent) diff --git a/lua/ui/lobby/lobbyComm.lua b/lua/ui/lobby/lobbyComm.lua index 59741d24d9..fe7a8b00e6 100644 --- a/lua/ui/lobby/lobbyComm.lua +++ b/lua/ui/lobby/lobbyComm.lua @@ -45,6 +45,7 @@ function GetDefaultPlayerOptions(playerName) } end +---@class DiscoveryService DiscoveryService = Class(moho.discovery_service_methods) { RemoveGame = function(self, index) LOG('DiscoveryService.RemoveGame(' .. tostring(index) .. ')') @@ -65,6 +66,7 @@ function CreateDiscoveryService() return service end +---@class LobbyComm : moho.lobby_methods LobbyComm = Class(moho.lobby_methods) { -- General events you should override diff --git a/lua/ui/texturepool.lua b/lua/ui/texturepool.lua index 27532afcc8..04ad456525 100644 --- a/lua/ui/texturepool.lua +++ b/lua/ui/texturepool.lua @@ -5,6 +5,7 @@ -- bitmaps required to show resources in map previews). -- Instead, initilise a TexturePool with the URL to the target texture, and it'll do object pooling -- for them in the obvious way. +---@class TexturePool TexturePool = Class() { __init = function(self, textureURL, textureParent, width, height) local Bitmap = import('/lua/maui/bitmap.lua').Bitmap diff --git a/lua/wreckage.lua b/lua/wreckage.lua index 64920d42b5..d8667c7d04 100644 --- a/lua/wreckage.lua +++ b/lua/wreckage.lua @@ -34,6 +34,7 @@ local EntitySetScale = EntityMethods.SetScale local EntitySetMesh = EntityMethods.SetMesh +---@class Wreckage : Prop Wreckage = Class(Prop) { OnCreate = function(self) diff --git a/run_lua_tests.sh b/run_lua_tests.sh index 320265b244..d71d72029b 100644 --- a/run_lua_tests.sh +++ b/run_lua_tests.sh @@ -23,8 +23,10 @@ while read file; do # file contains table pre-allocation synax ( {&1&4} ) that is not supported at the moment if [ "$file" != "./lua/lazyvar.lua" ]; then - check_file "$file" - (( files_checked++ )) + if [ "$file" != "./.vscode/fa-plugin.lua" ]; then + check_file "$file" + (( files_checked++ )) + fi fi done < <(find . -type d \( -path ./testmaps -o -path ./engine \) -prune -false -o -name '*.lua' -o -name '*.bp') diff --git a/schook/lua/GlobalInit.lua b/schook/lua/GlobalInit.lua index 522360ae51..ef74e5f9cc 100644 --- a/schook/lua/GlobalInit.lua +++ b/schook/lua/GlobalInit.lua @@ -1,2 +1,2 @@ --- shadow base game schook file \ No newline at end of file +-- shadow base game schook file diff --git a/schook/lua/simInit.lua b/schook/lua/simInit.lua index 522360ae51..ef74e5f9cc 100644 --- a/schook/lua/simInit.lua +++ b/schook/lua/simInit.lua @@ -1,2 +1,2 @@ --- shadow base game schook file \ No newline at end of file +-- shadow base game schook file