0% found this document useful (0 votes)
24 views3 pages

Respald Omaya 02

This document contains code for a game that generates enemy soldiers near the player's initial area over time. It places enemy ships near a bridgehead that deliver increasing numbers of enemy soldier types to attack the player every few minutes, as determined by variable timers and counters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Respald Omaya 02

This document contains code for a game that generates enemy soldiers near the player's initial area over time. It places enemy ships near a bridgehead that deliver increasing numbers of enemy soldier types to attack the player every few minutes, as determined by variable timers and counters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

-- =============================================================================

-- maya 02
-- Enemy soldiers are placed in certain periods at a coast near to the player's
-- initial area there is a bridgehead from the enemy
--
-- =============================================================================
-- -----------------------------------------------------------------------------
-- Init Variables
-- -----------------------------------------------------------------------------

function InitVar()

--// toggling flag for one-time call


Vars.Save1 = 1

--// set time period in minutes here


Vars.Save6 = 20 + Game.Random(5)

--// first time of "enemy landing"


Vars.Save2 =20 + Game.Random(5)

--// tickcounter
Vars.Save7 = 0

Vars.Save9 = 1

if Game.GetDifficulty() == 0 then
--// counters for # of soldiers for EASY
Vars.Save3 = 1
Vars.Save4 = 1
Vars.Save5 = 1
else
--// counters for # of soldiers for NORMAL
Vars.Save3 = 2
Vars.Save4 = 2
Vars.Save5 = 1
end

end

--// -----------------------------------------------------------------------------
--// Generate Ship & Enemy soldiers every Vars.Save2 min.
--// With growing number of soldiers
--// -----------------------------------------------------------------------------

function GenerateEnemies()
--// -----------------------------------------------------------------------------
--// switch ship on and deliever soldiers
--// -----------------------------------------------------------------------------
if Buildings.ExistsBuildingInArea(2,Buildings.GUARDTOWERBIG,352,392,5) == 0
and Buildings.ExistsBuildingInArea(2,Buildings.GUARDTOWERBIG,363,389,5) == 0 then

Vars.Save9 = 0
end
if Game.Time() == Vars.Save2 and Vars.Save1 == 1 and Vars.Save9 == 1 then
Vehicles.AddVehicle(297, 305, 2, Vehicles.WARSHIP, 5,80, 1)
AI.NewSquad(2, AI.CMD_MOVE_AND_VANISH, 345,368)
Vars.Save1 = 2
Vars.Save2 = Vars.Save2 + Vars.Save6
Vars.Save6 = 20 + Game.Random(5)

end

--//FAKE: ship returns to vikingsettlement


if Vehicles.AmountInArea(2,Vehicles.WARSHIP,345,363, 1)== 1 and Vars.Save1
== 2 then
Vars.Save1 = 3
end

--// wait some ticks


if Vars.Save1 == 3 then
Vars.Save7 = Vars.Save7 + 1
end

if Vars.Save1 == 3 and Vars.Save7 == 44 then


Vehicles.AddVehicle(345,368 , 2, Vehicles.WARSHIP, 2,80, 1)
AI.NewSquad(2, AI.CMD_MOVE_AND_VANISH, 297, 305)
Vars.Save1 = 1
Vars.Save7 = 0
--// Warrios leave the ship and attack the player
Settlers.AddSettlers(354, 381, 2, Settlers.SWORDSMAN_01, Vars.Save3)
Settlers.AddSettlers(353, 382, 2, Settlers.BOWMAN_02, Vars.Save4)
Settlers.AddSettlers(350, 382, 2, Settlers.AXEWARRIOR_02, Vars.Save5)
AI.NewSquad(2, AI.CMD_SUICIDE_MISSION )

--// increase number of soldiers for next delievery


if Game.GetDifficulty() == 0 then
Vars.Save3 = Vars.Save3 + 1
Vars.Save4 = Vars.Save4 + 1
Vars.Save5 = Vars.Save5 + 1
else
Vars.Save3 = Vars.Save3 + 2
Vars.Save4 = Vars.Save4 + 2
Vars.Save5 = Vars.Save5 + 1
end
end

end

--// -----------------------------------------------------------------------------
function new_game()
request_event(GenerateEnemies, Events.TICK)
request_event(InitVar,Events.FIRST_TICK_OF_NEW_GAME)
ShowEnemies_new_game()
end

-- -----------------------------------------------------------------------------
-- The "register_functions" function (registers functions, which requests events)
-- -----------------------------------------------------------------------------

function register_functions()
-- Every function, which requests events, must be registered here!
include("ShowEnemies.txt")
tinsert(gShowEnemies_Targets, {357,390})
ShowEnemies_register_functions()

reg_func(GenerateEnemies)
reg_func(InitVar)
end
en
Vars.Save3 = Vars.Save3 + 1
Vars.Save4 = Vars.Save4 + 1
Vars.Save5 = Vars.Save5 + 1
else
Vars.S

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy