SEVERANCE, BLADE OF DARKNESS

Bigtruck's pages

Updated July 16, 2005

HOME PAGETOOLS > PYTHON CODES > ADDING ENEMIES

 

 

ADDING ENEMIES
LEVELENM.PY FILE SYNTAX

import Bladex
# from math import pow
import EnemyTypes
import Sparks
import Actions
import pocimac
import Breakings
import ItemTypes
import darfuncs

import EnmGenRnd
import AuxFuncs
import OnOff

import LevelFuncs

import Doors
import Levers
import Locks
import Objects
import Sounds
import Button
import ReadGSFile
import Stars



### Set these values to the expected player's level (0-19) at the beginning of the map
expected_player_lvl_min= 6
expected_player_lvl_max= 19

lvl_control=LevelFuncs.EnemyLevelControl (expected_player_lvl_min, expected_player_lvl_max)
### e.g. to give an enemy a level between 0 and 4, do
### pers.Level= lvl_control.GiveLevel(0, 4)


################## room 1 enems

def unhiderm1ork():

darfuncs.UnhideBadGuy("rm1ork")

o=Bladex.CreateEntity("TombEspada5","Orksword",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs (o)
o=Bladex.CreateEntity("TombEscudo5","Escudo2",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs (o)

pers=Bladex.CreateEntity("rm1ork","Great_Ork",8918, -4118, 26000,"Person")
pers.Angle=2.3
pers.Level=5
Actions.TakeObject(pers.Name,"TombEspada5")
Actions.TakeObject(pers.Name,"TombEscudo5")

pers.Blind = 1
pers.Deaf = 1


#pers.ActionAreaMin=pow(2,2)
#pers.ActionAreaMax=pow(2,3)

EnemyTypes.EnemyDefaultFuncs(pers)


pers.SetOnFloor()

darfuncs.HideBadGuy("rm1ork")

darfuncs.EnterSecEvent(0, -4000, 13900, unhiderm1ork)


################### room 2 enems

def unhideskel1():

darfuncs.UnhideBadGuy("Skeleton1")

o=Bladex.CreateEntity("Islandesp2","Hacha4",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(o)
o=Bladex.CreateEntity("IslandEscudo2","Escudo1",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(o)

pers=Bladex.CreateEntity("Skeleton1","Skeleton",13983,-7118,7027,"Person")
pers.Angle=0.0
pers.Level=8
Actions.TakeObject(pers.Name,"Islandesp2")
Actions.TakeObject(pers.Name,"IslandEscudo2")
pers.Blind = 1
pers.Deaf = 1
#pers.ActionAreaMin=pow(2,4)
#pers.ActionAreaMax=pow(2,5)
pers.SetOnFloor()
EnemyTypes.EnemyDefaultFuncs(pers)

darfuncs.HideBadGuy("Skeleton1")

darfuncs.EnterSecEvent(12000, -7091, 12000, unhideskel1)


############

def unhideskel2():

darfuncs.UnhideBadGuy("Skeleton2")

pers=Bladex.CreateEntity("Skeleton2", "Skeleton",17627,-7118, 3615,"Person")
pers.Angle=0.0
pers.Level=10
pers.Blind = 1
pers.Deaf = 1
#pers.ActionAreaMin=pow(2,0)
#pers.ActionAreaMax=pow(2,1)
pers.SetOnFloor()

o=Bladex.CreateEntity("OasisArqEsp1","Espadaelfica",0,0,0,"Weapon")
inv=pers.GetInventory()
inv.AddWeapon("OasisArqEsp1")
ItemTypes.ItemDefaultFuncs(o)

EnemyTypes.EnemyDefaultFuncs(pers)

darfuncs.HideBadGuy("Skeleton2")

darfuncs.EnterSecEvent(12000, -7091, 12000, unhideskel2)

########################### room 3 enems

# a 4.5 430, -10118, -2426
# a 5.5 -412, -10118, -10915
# a 4.9 -552, -10118, -6639

# enter 9000, -10100, 1100

def unhiderm3min():

darfuncs.UnhideBadGuy("Minot0")

o=Bladex.CreateEntity("Hachacarnicero0","Mazapiedra",0,0,0,"Weapon")

pers=Bladex.CreateEntity("Minot0","Minotaur",-412, -10118, -10915,"Person")
pers.Level=13
pers.Angle=5.5
Actions.TakeObject(pers.Name,"Hachacarnicero0")
pers.Blind = 1
pers.Deaf = 1
#pers.ActionAreaMin=pow(2,2)
#pers.ActionAreaMax=pow(2,3)
EnemyTypes.EnemyDefaultFuncs(pers)
pers.SetOnFloor()
darfuncs.HideBadGuy(pers.Name)

darfuncs.EnterSecEvent(9000, -10100, 900, unhiderm3min)


########################## room 4 enems

# a 0.0 -15552, -13118, -1900
# enter -10000, -13100, 3446

#################################

#sspl33=Bladex.GetSector(-10010, -13100, 3446)
#sspl33.OnEnter=door4.CloseDoor()

################################

def GenerateBurnSkl(o):

#o.ActionAreaMin=pow(2,6)
#o.ActionAreaMax=pow(2,7)
o.CatchOnFire(0,0,0)

luz = Bladex.CreateEntity(o.Name+"Luz","Entity Spot",0,0,0)
#luz.Color = 200,100,0
luz.Color = 181,99,10
luz.Intensity = 6
luz.Precission = 0.077
luz.CastShadows = 0
luz.Visible = 1
luz.SizeFactor = 0
o.Link(luz)


def ApagaLuz(luz,l):
luze = Bladex.GetEntity(luz)
Luz=AuxFuncs.GetSpot(luze)
Luz.Intensity = 0.0
Luz.CastShadows = 0
Fire=AuxFuncs.GetFire(luze)
Fire.Intensity = 20.0


def StartBurnSkl2(sector,entity):
if (entity == "Player1"):
BrnSklSec2.OnEnter = ""
generadorBrnSkl.GenerateEnemy()


def finGeneraFuego(a=0,b=0,c=0):
OnOff.LightSetInens = 60.0
OnOff.LightSetRadius = 0.077
OnOff.LightSetColor = (255,70,9)
# OnOff.TurnOnLight("olimpia")


##############################


Bladex.AddCombustionDataFor("Skeleton", "Fire", 250, 400, 4, 1, 3, 144000) # se extingira en 40 horas!

generadorBrnSkl = EnmGenRnd.CreateEnemiesGenerator(10, 1)
generadorBrnSkl.Level = lvl_control.GiveLevel(10, 16)

generadorBrnSkl.AddPoint((-19165, -13100, 729),("BrnSkl1", "Skeleton", "HookSword", 0, "Escudo4", 1), "Skl_appears1")


generadorBrnSkl.InitGenFunc=GenerateBurnSkl
generadorBrnSkl.DifTime = 0.6
#generadorBrnSkl.VirGenPos = -7000,-40000,0
generadorBrnSkl.FinishGenFunc = finGeneraFuego
generadorBrnSkl.Activate()


BrnSklSec2 = Bladex.GetSector(-10000, -13100, 3446)
BrnSklSec2.OnEnter = StartBurnSkl2


###################################


################### ork with bow at the top

def unhidetork():

darfuncs.UnhideBadGuy("topork")

pers=Bladex.CreateEntity("topork","Ork",4385,-41118,7611,"Person")
pers.Angle=3.2
pers.Level=lvl_control.GiveLevel(10,19)
pers.SetOnFloor()

bowtop=Bladex.CreateEntity("toporkbow","Arco",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(bowtop)
Actions.TakeObject(pers.Name,bowtop.Name)

quivertop=Bladex.CreateEntity("toporkquiver","CarcajEnvenenado",0,0,0,"Physic")
ItemTypes.ItemDefaultFuncs (quivertop)
quivertop.Data.SetNumberOfArrows(10, pers.Name)
Actions.TakeObject(pers.Name,quivertop.Name)

swordtop=Bladex.CreateEntity("toporksword","Orksword",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(swordtop)
Actions.TakeObject(pers.Name,swordtop.Name)

potiontop=Bladex.CreateEntity("Potion1","PocimaTodo",0,0,0,"Physic")
potiontop.Scale=1.220190
pocimac.CreatePotion(potiontop.Name)
Actions.TakeObject(pers.Name,potiontop.Name)

EnemyTypes.EnemyDefaultFuncs(pers)

darfuncs.HideBadGuy("topork")

darfuncs.EnterSecEvent(596, -41118, -2237, unhidetork)



### pair of dark knights

### added code from deffuncs to unhide monster when player enters sector below

def unhide5dkgt():

darfuncs.UnhideBadGuy("5DKGT")


pers=Bladex.CreateEntity("5DKGT", "Dark_Knight", 4171, -11500, 26333,"Person")
pers.Angle=3.5

pers.Level=lvl_control.GiveLevel(0,10)

### this part is not working
### the monster wont attack only looks at you
### with it removed they never stop attacking lol

### pers.ActionAreaMin=pow(2,4)
### pers.ActionAreaMax=pow(2,5)

pers.SetOnFloor()

bow1=Bladex.CreateEntity("towerbow5","Arco",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(bow1)
Actions.TakeObject(pers.Name,bow1.Name)

quiver1=Bladex.CreateEntity("towerquiver5","CarcajEnvenenado",0,0,0,"Physic")
ItemTypes.ItemDefaultFuncs (quiver1)
quiver1.Data.SetNumberOfArrows(10, pers.Name)
Actions.TakeObject(pers.Name,quiver1.Name)

sword1=Bladex.CreateEntity("towerEspada5","EgyptSword",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(sword1)
Actions.TakeObject(pers.Name,sword1.Name)

EnemyTypes.EnemyDefaultFuncs(pers)


darfuncs.HideBadGuy("5DKGT")

darfuncs.EnterSecEvent(8780, -13260, 11250, unhide5dkgt)


### dk2

def unhide6dkgt():

darfuncs.UnhideBadGuy("6DKGT")

pers=Bladex.CreateEntity("6DKGT","Dark_Knight",4700,-12225,23020,"Person")
pers.Angle=3
pers.Level=lvl_control.GiveLevel(0,10)
pers.SetOnFloor()

sword=Bladex.CreateEntity("towerEspada6","DoubleSword",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(sword)
Actions.TakeObject(pers.Name,sword.Name)

shield=Bladex.CreateEntity("towerEscudo6","Escudo7",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(shield)
Actions.TakeObject(pers.Name,shield.Name)

potion=Bladex.CreateEntity("Potion20","Pocima200",0,0,0,"Physic")
potion.Scale=1.220190
pocimac.CreatePotion(potion.Name)
Actions.TakeObject(pers.Name,potion.Name)

EnemyTypes.EnemyDefaultFuncs(pers)

darfuncs.HideBadGuy("6DKGT")

darfuncs.EnterSecEvent(8780, -13260, 11250, unhide6dkgt)



### end of levelenm.py