The search keyword must be a single word (no spaces).

Function CampaignBasicsA

Line
2344
Location
common.ai
Constant?
no
Type
function
Arguments
nothing
Returns
nothing
2344
function CampaignBasicsA takes nothing returns nothing
2345
    local integer food_each = GetFoodMade(racial_farm)
2346
    local integer on_wood
2347
2348
    call ClearHarvestAI()
2349
2350
    if CaptainInCombat(false) then
2351
        set on_wood = 0
2352
    else
2353
        set on_wood = campaign_wood_peons
2354
    endif
2355
2356
    call HarvestGold(0,campaign_gold_peons)
2357
    call HarvestWood(0,on_wood)
2358
2359
    if harvest_town1 then
2360
        call HarvestGold(1,campaign_gold_peons)
2361
        call HarvestWood(1,on_wood)
2362
    endif
2363
2364
    if harvest_town2 then
2365
        call HarvestGold(2,campaign_gold_peons)
2366
        call HarvestWood(2,on_wood)
2367
    endif
2368
2369
    if harvest_town3 then
2370
        call HarvestGold(3,campaign_gold_peons)
2371
        call HarvestWood(3,on_wood)
2372
    endif
2373
2374
    if do_campaign_farms and FoodUsed()+food_each-1 > food_each*(TownCount(racial_farm)+1) then
2375
        call StartUnit(TownCount(racial_farm)+1,racial_farm,-1)
2376
    endif
2377
2378
    if build_campaign_attackers then
2379
        call BuildAttackers()
2380
    endif
2381
2382
    if not CaptainInCombat(false) then
2383
        call BuildDefenders()
2384
    endif
2385
2386
    call FillGuardPosts()
2387
    call ReturnGuardPosts()
2388
endfunction