diff --git a/Docs/TODO_List.md b/Docs/TODO_List.md new file mode 100644 index 0000000..6056cae --- /dev/null +++ b/Docs/TODO_List.md @@ -0,0 +1,5 @@ +# TODO +## Airboss +- 无线电选择航母turn into wind. +- 创建回收直升机 Recover Helo. +- 无线电请求S3B tanker. \ No newline at end of file diff --git a/Scripts/Airboss[CN].lua b/Scripts/Airboss[CN].lua index 986648a..e29083b 100644 --- a/Scripts/Airboss[CN].lua +++ b/Scripts/Airboss[CN].lua @@ -6114,8 +6114,7 @@ function AIRBOSS:_CreateFlightGroup( group ) element.ballcall = false element.ai = not self:_IsHumanUnit( unit ) element.recovered = nil - -- text = text .. string.format( "\n[%d] %s onboard #%s, AI=%s", i, element.unitname, tostring( element.onboard ), tostring( element.ai ) ) - text = text .. string.format( "\n[%d] %s 在甲板上 #%s, AI=%s", i, element.unitname, tostring( element.onboard ), tostring( element.ai ) ) + text = text .. string.format( "\n[%d] %s onboard #%s, AI=%s", i, element.unitname, tostring( element.onboard ), tostring( element.ai ) ) table.insert( flight.elements, element ) end self:T( self.lid .. text ) @@ -13310,32 +13309,55 @@ function AIRBOSS:_GetOnboardNumbers( group, playeronly ) -- Debug text. local text = string.format( "Onboard numbers of group %s:", groupname ) - -- Units of template group. - local units = group:GetTemplate().units + local template=group:GetTemplate() - -- Get numbers. local numbers = {} - for _, unit in pairs( units ) do + if template then - -- Onboard number and unit name. - local n = tostring( unit.onboard_num ) - local name = unit.name - local skill = unit.skill or "Unknown" + -- Units of template group. + local units = template.units - -- Debug text. - text = text .. string.format( "\n- unit %s: onboard #=%s skill=%s", name, n, tostring( skill ) ) + -- Get numbers. + for _, unit in pairs( units ) do - if playeronly and skill == "Client" or skill == "Player" then - -- There can be only one player in the group, so we skip everything else. - return n + -- Onboard number and unit name. + local n = tostring( unit.onboard_num ) + local name = unit.name + local skill = unit.skill or "Unknown" + + -- Debug text. + text = text .. string.format( "\n- unit %s: onboard #=%s skill=%s", name, n, tostring( skill ) ) + + if playeronly and skill == "Client" or skill == "Player" then + -- There can be only one player in the group, so we skip everything else. + return n + end + + -- Table entry. + numbers[name] = n end - -- Table entry. - numbers[name] = n - end + -- Debug info. + self:T2( self.lid .. text ) - -- Debug info. - self:T2( self.lid .. text ) + else + + if playeronly then + return 101 + else + + local units=group:GetUnits() + + for i,_unit in pairs(units) do + local name=_unit:GetName() + + numbers[name]=100+i + + end + + end + + end return numbers end