//
// Quake game definition file (.fgd)
// for Worldcraft 1.6 and above
//
// written by autolycus / autolycus@planetquake.com
// email me with improvements and suggestions
//

//Modified by CZG : grawert@online.no : http://www.planetquake.com/greyvoid/

//
// worldspawn
//

@SolidClass = worldspawn : "World entity"
[
	message(string) : "Text on entering the world"
	worldtype(choices) : "Ambience" : 0 =
	[
		0 : "Medieval"
		1 : "Metal (runic)"
		2 : "Base"
	]
	sounds(integer) : "CD track to play" : 0
	light(integer) : "Ambient light"
	_sunlight(integer) : "Sunlight"
	_sun_mangle(string) : "Sun mangle (Yaw pitch roll)"
]

//
// base marker definitions
//

@baseclass = Appearflags [
	spawnflags(Flags) =
	[
		256 : "Not on Easy" : 0
		512 : "Not on Normal" : 0
		1024 : "Not on Hard" : 0
		2048 : "Not in Deathmatch" : 0
	]
]

@baseclass = Targetname [ targetname(target_source) : "Name" ]
@baseclass = Target [ 
	target(target_destination) : "Target" 
	killtarget(target_destination) : "Killtarget"
]



//
// player starts, deathmatch, coop, teleport
//

@baseclass base(Appearflags) size(-16 -16 -24, 16 16 32) 
	color(0 255 0) model(":progs/player.mdl") = PlayerClass []

@PointClass base(PlayerClass) = info_player_start : "Player 1 start" []
@PointClass base(PlayerClass) = info_player_coop : "Player cooperative start" []
@PointClass base(PlayerClass) = info_player_start2 : "Player episode return point" []
@PointClass base(PlayerClass) = info_player_deathmatch : "Deathmatch start" []
@PointClass size(-32 -32 0, 32 32 64) base(PlayerClass, Targetname) = info_teleport_destination : "Teleporter destination" []
@PointClass = info_null : "info_null (spotlight target)"
[
	targetname(target_source) : "Name" 
]

@PointClass base(Appearflags, Target, Targetname) = info_notnull : "Wildcard entity" // I love you
[
	use(string) : "self.use"
	think(string) : "self.think"
	nextthink(integer) : "nextthink"
	noise(string) : "noise"
	touch(string) : "self.touch"
]
@PointClass base(Appearflags) = info_intermission : "Intermission camera" 
[
	mangle(string) : "Camera angle (Pitch Yaw Roll)"
]

//
// items
//
@baseclass base(Appearflags, Target, Targetname) = Item
[
	message(string) : "Message"
	target(string) : "Target"
	killtarget(string) : "Killtarget"
	delay(integer) : "Delay"
]
@baseclass size(0 0 0, 32 32 56) color(80 0 200) base(Item) = Ammo
[
	spawnflags(flags) = 
	[
		1 : "Large box" : 0
	]
]

@PointClass 
    base(Ammo) 
    model(
        ":maps/b_batt0.bsp", 
        ":maps/b_batt1.bsp" spawnflags = 1
    ) = 
    item_cells : "Thunderbolt ammo" []
    
@PointClass 
    base(Ammo) 
    model(
        ":maps/b_rock0.bsp",
        ":maps/b_rock1.bsp" spawnflags = 1
    ) =
    item_rockets : "Rockets" []

@PointClass
    base(Ammo)
    model(
        ":maps/b_shell0.bsp",
        ":maps/b_shell1.bsp" spawnflags = 1
    ) = item_shells : "Shells" []
    
@PointClass 
    base(Ammo) 
    model(
        ":maps/b_nail0.bsp",
        ":maps/b_nail1.bsp" spawnflags = 1
    ) = item_spikes : "Nailgun/Perforator ammo" []

@PointClass 
    size(0 0 0, 32 32 16) 
    base(Appearflags) 
    model(
        ":maps/b_bh25.bsp",
        ":maps/b_bh10.bsp" spawnflags = 1,
        ":maps/b_bh100.bsp" spawnflags = 2
    ) =
    item_health : "Health pack" 
[
	spawnflags(flags) = 
	[
		1 : "Rotten" : 0
		2 : "Megahealth" : 0
	]
]

@PointClass base(Item, Appearflags) model(":progs/suit.mdl") = 
	item_artifact_envirosuit : "Environmental protection suit" []
@PointClass base(Item, Appearflags) model(":progs/quaddama.mdl") = 
	item_artifact_super_damage : "Quad damage" []
@PointClass base(Item, Appearflags) model(":progs/invulner.mdl") = 
	item_artifact_invulnerability : "Pentagram of Protection" []
@PointClass base(Item, Appearflags) model(":progs/invisibl.mdl") = 
	item_artifact_invisibility : "Ring of Shadows" []

@PointClass size(-16 -16 0, 16 16 56) base(Item, Appearflags) model(":progs/armor.mdl" 2) = 
	item_armorInv : "Red armor (200%)" []
@PointClass size(-16 -16 0, 16 16 56) base(Item, Appearflags) model(":progs/armor.mdl" 1) = 
	item_armor2 : "Yellow armor (150%)" []
@PointClass size(-16 -16 0, 16 16 56) base(Item, Appearflags) model(":progs/armor.mdl") =
	item_armor1 : "Green armor (100%)" []
@PointClass size(-16 -16 -24, 16 16 32) base(Item, Appearflags) model(":progs/w_s_key.mdl") = 
	item_key1 : "Silver key" []
@PointClass size(-16 -16 -24, 16 16 32) base(Item, Appearflags) model(":progs/w_g_key.mdl") = 
	item_key2 : "Gold key" []
@PointClass size(-16 -16 -24, 16 16 32) base(Item, Appearflags) model(":progs/end1.mdl") = 
	item_sigil : "Sigil"
[
	spawnflags(Flags) =
	[
		1 : "Episode 1" : 1
		2 : "Episode 2" : 0
		4 : "Episode 3" : 0
		8 : "Episode 4" : 0
	]
]

//
// weapons
//

@baseclass size(-16 -16 0, 16 16 56) color(0 0 200) base(Item, Appearflags) = Weapon []

@PointClass base(Weapon) model(":progs/g_shot.mdl") = weapon_supershotgun : "Double-barreled shotgun" []
@PointClass base(Weapon) model(":progs/g_nail.mdl") = weapon_nailgun : "Nailgun" []
@PointClass base(Weapon) model(":progs/g_nail2.mdl") = weapon_supernailgun : "Super nailgun" []
@PointClass base(Weapon) model(":progs/g_rock.mdl") = weapon_grenadelauncher : "Grenade launcher" []
@PointClass base(Weapon) model(":progs/g_rock2.mdl") = weapon_rocketlauncher : "Rocket launcher" []
@PointClass base(Weapon) model(":progs/g_light.mdl") = weapon_lightning : "Thunderbolt" []

//
// monsters
//

@baseclass base(Appearflags, Target, Targetname) color(220 0 0) = Monster 
[
	spawnflags(Flags) = 
	[
		1 : "Ambush" : 0
	]
]

@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model(":progs/soldier.mdl") = monster_army : "Grunt" []
@PointClass base(Monster) size(-32 -32 -24, 32 32 40) model(":progs/dog.mdl") = monster_dog : "Nasty Doggie" []
@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model(":progs/ogre.mdl") = monster_ogre : "Ogre" []
@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model(":progs/ogre.mdl") = monster_ogre_marksman : "Ogre marksman" []
@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model(":progs/knight.mdl") = monster_knight : "Knight" []
@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model(":progs/hknight.mdl") = monster_hell_knight : "Hell knight" []
@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model(":progs/wizard.mdl") = monster_wizard : "Scrag" []
@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model(":progs/demon.mdl") = monster_demon1 : "Fiend" []
@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model(":progs/shambler.mdl") = monster_shambler : "Shambler" []
@PointClass base(Monster) size(-128 -128 -24, 128 128 256) model(":progs/boss.mdl") = monster_boss : "Chthon" []
@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model(":progs/enforcer.mdl") = monster_enforcer : "Enforcer" []
@PointClass base(Monster) size(-32 -32 -24, 32 32 48) model(":progs/shalrath.mdl") = monster_shalrath : "Vore" []
@PointClass base(Monster) size(32 32 48) model(":progs/tarbaby.mdl") = monster_tarbaby : "Spawn" []
@PointClass base(Monster) size(32 32 48) model(":progs/fish.mdl") = monster_fish : "Rotfish" []
@PointClass base(Monster) size(-16 -16 -24, 16 16 32) model(":progs/oldone.mdl") = monster_oldone : "Shub-Niggurath" []
@PointClass base(Monster) size(-16 -16 -24, 16 16 32) model(":progs/zombie.mdl") = monster_zombie : "Zombie" 
[
	spawnflags(Flags) = 
	[
		1 : "Crucified" : 0
		2 : "Ambush" : 0
	]
]

//
// lights
//

@baseclass color(255 255 40) = Light [
	light(integer) : "Brightness" : 300
	wait(integer) : "Fade distance multiplier" : 1
	delay(choices) : "Attenuation" =
	[
		0 : "Linear falloff (Default)"
		1 : "Inverse distance falloff"
		2 : "Inverse distance squared"
		3 : "No falloff"
		4 : "Local minlight"
		5 : "Inverse distance squared B"
	]
	mangle(string) : "Spotlight angle"
	style(Choices) : "Appearance" : 0 =
	[
		0 : "Normal"
		10: "Fluorescent flicker"
		2 : "Slow, strong pulse"
		11: "Slow pulse, noblack"
		5 : "Gentle pulse"
		1 : "Flicker A"
		6 : "Flicker B"
		3 : "Candle A"
		7 : "Candle B"
		8 : "Candle C"
		4 : "Fast strobe"
		9 : "Slow strobe"
	]
]

@PointClass size(-8 -8 -8, 8 8 8) base(Light, Target, Targetname) = 
	light : "Invisible light source"
	[
		spawnflags(Flags) = [ 1 : "Start off" : 0 ]
	]
@PointClass size(-8 -8 -8, 8 8 8) base(Light, Target, Targetname) = 
	light_fluoro : "Fluorescent light"
	[
		spawnflags(Flags) = [ 1 : "Start off" : 0 ]
	]
@PointClass size(-8 -8 -8, 8 8 8) base(Light, Target, Targetname) = 
	light_fluorospark : "Sparking fluorescent light"
	[
		spawnflags(Flags) = [ 1 : "Start off" : 0 ]
	]
@PointClass size(-8 -8 -8, 8 8 8) base(Appearflags, Light, Target, Targetname) = 
	light_globe : "Globe light"
	[
		spawnflags(Flags) = [ 1 : "Start off" : 0 ]
	]
@PointClass size(-8 -8 -12, 8 8 20) base(Appearflags, Light, Target, Targetname) model(":progs/flame2.mdl") = 
	light_flame_large_yellow : "Large yellow flame"
	[
		spawnflags(Flags) = [ 1 : "Start off" : 0 ]
	]
@PointClass size(-4 -4 -12, 4 4 20) base(Appearflags, Light, Target, Targetname) model(":progs/flame2.mdl") = 
	light_flame_small_yellow : "Small yellow flame" 
	[
		spawnflags(Flags) = [ 1 : "Start off" : 0 ]
	]
@PointClass size(-4 -4 -12, 4 4 20) base(Appearflags, Light, Target, Targetname) model(":progs/flame2.mdl") = 
	light_flame_small_white : "Small white flame"
	[
		spawnflags(Flags) = [ 1 : "Start off" : 0 ]
	]
@PointClass size(-4 -4 -12, 4 4 20) base(Appearflags, Light, Target, Targetname) model(":progs/flame.mdl") = 
	light_torch_small_walltorch : "Small walltorch" []

//
// misc
//

@SolidClass base(Appearflags) = func_illusionary : "Static nonsolid model"  []

@PointClass base(Appearflags, Name) = air_bubbles : "Air bubbles" []
@PointClass base(Appearflags, Targetname) =
	event_lightning : "Chthon's lightning" []
@PointClass base(Appearflags) = misc_fireball : "Small fireball"
	[ speed(integer) : "Speed" : 40 ]
@PointClass base(Appearflags) size(0 0 0, 32 32 64) model(":maps/b_explob.bsp") = misc_explobox : "Large exploding container" []
@PointClass base(Appearflags) size(0 0 0, 32 32 32) model(":maps/b_exbox2.bsp") = misc_explobox2 : "Small exploding container" []
@PointClass base(Appearflags) size(-8 -8 -8, 8 8 8) model(":progs/teleport.mdl") = misc_teleporttrain : "Flying teleporter destination"
[
	target(string) : "First stop target"
	targetname(target_source) : "Name" 
]
@PointClass base(Appearflags, Targetname) = trap_spikeshooter : "Triggered shooter" 
[
	angle(integer) : "Direction"
	spawnflags(Flags) = 
	[
		1 : "Spike" : 0
		2 : "Laser" : 0
	]
]
@PointClass base(Appearflags) = trap_shooter : "Continuous shooter"
[
	angle(integer) : "Direction"
	nextthink(integer) : "Delay before first spike"
	wait(integer) : "Delay between spikes"
	spawnflags(Flags) = 
	[
		1 : "Spike" : 0
		2 : "Laser" : 0
	]
]

@SolidClass = func_group : "Group of brushes for in-editor use" []
@SolidClass = func_detail : "Group of brushes for certain compilers " []

// 
// ambient sounds
//

@PointClass base(Appearflags) = ambient_drip : "Dripping sound" []
@PointClass base(Appearflags) = ambient_drone : "Engine/machinery sound" []
@PointClass base(Appearflags) = ambient_comp_hum : "Computer background sounds" []
@PointClass base(Appearflags) = ambient_flouro_buzz : "Fluorescent buzzing sound" []
@PointClass base(Appearflags) = ambient_light_buzz : "Buzzing sound from light" []
@PointClass base(Appearflags) = ambient_suck_wind : "Wind sound" []
@PointClass base(Appearflags) = ambient_swamp1 : "Frogs croaking" []
@PointClass base(Appearflags) = ambient_swamp2 : "Frogs croaking B" []
@PointClass base(Appearflags) = ambient_thunder : "Thunder sound" []

// 
// moving things
//


@SolidClass base(Appearflags, Targetname, Target) = func_door : "Basic door" 
[
	speed(integer) : "Speed" : 100
	sounds(choices) : "Sound" : 0 = 
	[
        0: "Silent"
		1: "Stone"
		2: "Machine"
		3: "Stone Chain"
		4: "Screechy Metal"
	]
	wait(string) : "Wait before close" : "4" 
	lip(integer) : "Lip" : 8
	dmg(integer) : "Damage inflicted when blocked" : 0
	message(string) : "Message if touched"
	health(integer) : "Health (shootable)" : 0
	spawnflags(flags) =
	[
		1 : "Starts Open" : 0
		4 : "Don't link" : 0
		8 : "Gold Key required" : 0
        16: "Silver Key required" : 0
        32: "Toggle" : 0
	]
]

@SolidClass base(Appearflags, Targetname, Target) = func_door_secret : "Secret door" 
[
	t_width(integer) : "First move length"
	t_length(integer) : "Second move length"
	dmg(integer) : "Damage when blocked" : 2
	wait(string) : "Wait before close" : "2"
	sounds(choices) : "Sounds" : 3 =
	[
		1: "Medieval"
		2: "Metal"
		3: "Base"
	]
	message(string) : "Message"
	spawnflags(flags) = 
	[
		1 : "Open once" : 0
		2 : "Move left first" : 0
		4 : "Move down first" : 0
		8 : "Not shootable" : 0
        16 : "Always shootable" : 0
	]
]

@SolidClass base(Appearflags, Targetname) = func_wall : "Wall" []


@SolidClass base(Targetname) = func_button : "Button" 
[
	speed(integer) : "Speed" : 40
	lip(integer) : "Lip" : 4
	target(target_source) : "Target"
	health(integer) : "Health (shootable)"
	sounds(choices) : "Sounds" = 
	[
		0 : "Steam metal"
		1 : "Wooden clunk"
		2 : "Metallic clink"
		3 : "In-out"
	]
	wait(string) : "Wait before reset" : "1"
	delay(string) : "Delay before trigger"
	message(string) : "Message" 
]

@SolidClass base(Appearflags, Targetname) = func_train : "Moving platform" 
[
	sounds(choices) : "Sound" : 1 =
	[
		0: "Silent"
		1: "Ratchet Metal"
	]
	speed(integer) : "Speed (units per second)" : 64
	target(target_source) : "First stop target"
	dmg(integer) : "Damage on block" : 0
]

@PointClass base(Appearflags, Targetname) size(16 16 16) = 
	path_corner : "Path corner for platforms and monsters"
[
	target(target_source) : "Next target"
	wait(integer) : "Wait" : 0
]

@SolidClass base(Appearflags, Targetname) = func_plat : "Elevator" 
[	
	spawnflags(Flags) =
	[
		1 : "Low trigger volume" : 0
	]
	speed(integer) : "Speed" : 150
	height(integer) : "Travel altitude (can be negative)" : 0
	sounds(choices) : "Sound" : 1 =
	[
		0: "None"
		1: "Base fast"
		2: "Chain Slow"
	]
]	

@SolidClass base(Appearflags) = func_episodegate : "Episode Gate"
[
	spawnflags(Flags) =
	[
		1 : "Episode 1" : 1
		2 : "Episode 2" : 0
		4 : "Episode 3" : 0
		8 : "Episode 4" : 0
	]
]

@SolidClass base(Appearflags) = func_bossgate : "Boss gate" []

//
// triggers
//

@baseclass base(Appearflags, Target, Killarget, Targetname) = Trigger
[
	sounds(choices) : "Sound style" : 0 =
	[
		0 : "None"
		1 : "Secret sound"
		2 : "Beep beep"
		3 : "Large switch"
	]
	delay(string) : "Delay before trigger" : "0"
	message(string) : "Message"
]

@SolidClass base(Trigger) = trigger_changelevel : "Trigger: Change level"
[
	map(string) : "Next map"
	target(target_destination) : "Target"
	spawnflags(flags) =
	[
		1: "No intermission" : 0
	]
]

@SolidClass base(Trigger) = trigger_once : "Trigger: Activate once"
[
	health(integer) : "Health (shootable)"
	spawnflags(flags) = [ 1: "Not touchable" : 0 ]
]
@SolidClass base(Trigger) = trigger_multiple : "Trigger: Activate multiple" 
[
	wait(string) : "Wait before reset" : "4"
	health(integer) : "Health (shootable)"
	spawnflags(flags) = [ 1: "Not touchable" : 0 ]
]
@SolidClass base(Trigger) = trigger_onlyregistered : "Trigger: Registered only" 
[
	spawnflags(flags) = [ 1: "Not touchable" : 0 ]
]
@SolidClass base(Trigger) = trigger_secret : "Trigger: Secret" 
[
	sounds(choices) : "Sound" : 1 =
	[
		1 : "Secret sound"
		2 : "Beep beep"
	]
	spawnflags(flags) = [ 1: "Not touchable" : 0 ]
]

@SolidClass base(Appearflags, Target, Targetname) = trigger_teleport : "Trigger: Teleporter" 
[
	spawnflags(Flags) =
	[
		1 : "Player only" : 0
		2 : "Silent" : 0
	]
]

@SolidClass base(Appearflags) = trigger_setskill : "Trigger: Set skill" 
[
	message(choices) : "Skill to change to" : 1 =
	[
        0 : "Easy"
        1 : "Medium"
        2 : "Hard"
        3 : "Nightmare!"
	]
]
@PointClass base(Trigger) = trigger_relay : "Trigger: Relay"
[
]
@SolidClass base(Appearflags, Targetname) = trigger_monsterjump : "Trigger: Monster jump" 
[
	speed(integer) : "Jump Speed" : 200
	height(integer) : "Jump Height" : 200
]
@PointClass base(Appearflags, Target, Targetname) = trigger_counter : "Trigger: Counter" 
[
	spawnflags(flags) = [ 1: "No Message" : 0 ]
	count(integer) : "Count before trigger" : 2
	delay (integer) : "Delay"
	message(string) : "Message"
]
@SolidClass base(Appearflags, Targetname) = trigger_push : "Trigger: Push"
[
	spawnflags(flags) = [ 1: "Push once" : 0 ]
	speed(integer) : "Speed" : 1000
]
@SolidClass  base(Appearflags, Targetname) = trigger_hurt : "Trigger: Hurt" 
[
	dmg(integer) : "Damage per second" : 5
]
@PointClass size(16 16 16) = misc_noisemaker : "Debug entity" []
@PointClass size(16 16 16) = viewthing : "Fake player" []
