Skip to content
Permalink
Browse files

Add some super basic stats for testing

Convert hive to a factory
  • Loading branch information...
ForbodingAngel committed Jun 12, 2019
1 parent 058de99 commit cea43401c7c86be179994f502caa7f85b2c5f968
@@ -56,8 +56,14 @@ Shared.buildListeCommanderFactory = {
}

Shared.buildListZaal = {
[[zhive]],
[[zlightswarm]],
[[zmedswarm]],
[[zskirmisher]],
[[zpyro]],
[[zassault]],
[[zarty]],
[[zkamikaze]],
[[zqueen]],
}

local turrets = {
BIN +67 Bytes (100%) Objects3D/zaal/zhive.s3o
Binary file not shown.
@@ -0,0 +1,136 @@

#include "sfxtype.h"
#include "exptype.h"

piece base, nanopoint1, nanopoint2, mouth;

static-var Maya, building, spray;

// Signal definitions (they must be distincts power of 2)
#define SIG_ACTIVATE 2
#define SIG_BUILDING 4

SmokeUnit()
{
var healthpercent, sleeptime, smoketype;
while( TRUE )
{
healthpercent = get HEALTH;
if( healthpercent < 66 )
{
smoketype = SFXTYPE_BLACKSMOKE;
if( Rand( 1, 66 ) < healthpercent )
smoketype = SFXTYPE_WHITESMOKE;
emit-sfx 1025 from mouth;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
sleeptime = 200;
sleep sleeptime;
}
}


buildingfx()
{
while( TRUE )
{
if (building)
{
emit-sfx 1024 from mouth;
}
sleep 300;
}
}

Create()
{
spray = 0;
while( get BUILD_PERCENT_LEFT )
sleep 400;
start-script SmokeUnit();
start-script Buildingfx();
}


QueryNanoPiece(piecenum)
{
piecenum = nanopoint2;
}

Activate()
{
// Kill any other Activate or Deactivate:
signal SIG_ACTIVATE;
// Flag self so it can be killed:
set-signal-mask SIG_ACTIVATE;
// Local variables
// Open animation:
// Try to open the yard
set YARD_OPEN to TRUE;
// If yard not open, tell units around to bugger off until yard is open
while( !get YARD_OPEN )
{
set BUGGER_OFF to TRUE;
sleep 1500;
set YARD_OPEN to TRUE;
}
set BUGGER_OFF to FALSE;
// Now yard is open.
// Allow the nano to flow:
set INBUILDSTANCE to TRUE;
// Send wheel spinning:
// The idle but activated animation
}

Deactivate()
{
// Kill any other Activate or Deactivate:
signal SIG_ACTIVATE;
// Flag self so it can be killed:
set-signal-mask SIG_ACTIVATE;
// Switch off the nano faucet:
set INBUILDSTANCE to FALSE;
// Stop wheel spinning
// Try to close the yard
set YARD_OPEN to FALSE;
// If yard not closed, tell units around to bugger off until yard is closed
while( get YARD_OPEN )
{
set BUGGER_OFF to TRUE;
sleep 1500;
set YARD_OPEN to FALSE;
}
set BUGGER_OFF to FALSE;
// Now yard is closed.
// Close animation:
}

StartBuilding()
{
signal SIG_BUILDING; // Kill any other StartBuilding
set-signal-mask SIG_BUILDING; // Be killable
building = 1;
while(TRUE)
{
emit-sfx 1024 from nanopoint2;
sleep 600;
}
}

StopBuilding()
{
signal SIG_BUILDING; // Kill StartBuilding
building = 0;
}

QueryBuildInfo(piecenum)
{
piecenum = nanopoint1;
}


Killed(severity, corpsetype) // how it explodes
{
corpsetype = 1;
}
BIN +1.32 KB Scripts/zaal/zhive.cob
Binary file not shown.
@@ -1,84 +1,68 @@
unitDef = {

activateWhenBuilt = true,
acceleration = 1,
brakeRate = 0.24,
buildAngle = 2048,
activatewhenbuilt = false,
buildAngle = 1024,
buildCostEnergy = 0,
buildCostMetal = buildCostMetal,
buildingMask = 0,
buildDistance = 1500,
builder = true,
buildTime = 5,
buildPic = "zaal_unitpics/zroost.png",
capturable = false,
CanAttack = false,
CanAssist = true,
canBeAssisted = true,
CanCapture = false,
CanRepair = true,
canRestore = false,
canGuard = true,
canMove = true,
canPatrol = true,
canreclaim = false,
category = "BUILDING NOTAIR ECO",
description = [[Generates Metal from Resource Nodes]],
buildpic = "ebasefactory.png",
canAttack = false,
canBeAssisted = true,
canGuard = true,
canMove = true,
canPatrol = true,
canReclaim = false,
canstop = true,
category = "BUILDING NOTAIR",
description = [[Build a Tech Facility to unlock units. Build Supply Depots to increase your army size.]],
energyStorage = 0,
energyUse = energyUse,
explodeAs = "largeBuildingExplosionGenericRed",
makesMetal = 0,
footprintX = 16,
footprintZ = 16,
iconType = "eco",
energyUse = 0,
energyMake = 0,
explodeAs = "hugeBuildingExplosionGeneric",
footprintX = 8,
footprintZ = 8,
floater = true,
iconType = "factory",
idleAutoHeal = .5,
idleTime = 2200,
maxDamage = 1000,
maxSlope = 90,
maxVelocity = 0.001,
maxReverseVelocity = 0.001,
maxWaterDepth = 5000,
maxDamage = maxDamage,
maxSlope = 25,
maxWaterDepth = 99999999999,
metalStorage = 0,
metalMake = 0,
name = humanName,
objectName = objectName,
movementClass = "EXPERIMENTALTANK12",
pushResistant = true,
script = script,
onoffable = false,
radarDistance = 0,
repairable = false,
selfDestructAs = "largeBuildingExplosionGenericRed",
selfDestructCountdown = 15,
showNanoSpray = false,
selfDestructAs = "hugeBuildingExplosionGeneric",
showNanoSpray = true,
side = "CORE",
sightDistance = 200,
sightDistance = 388,
smoothAnim = true,
unitName = unitName,
workerTime = 1,
capturespeed = 0.25,
TerraformSpeed = 2147000,
ReclaimSpeed = 0,
-- 0.03125 = 1 hp per second
repairspeed = 0.5,
yardMap = "oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo ",
TEDClass = "PLANT",
unitname = unitName,
-- unitRestricted = 1,
workerTime = 1,
yardMap = "oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo oooyyyyyyyyyyyyyyooo",
-- usePieceCollisionVolumes = true,
-- modelCenterOffset = {108, 10, 0},
sfxtypes = {
pieceExplosionGenerators = {
"deathceg3",
"deathceg4",
"blood_spray",
},

explosiongenerators = {
"custom:blacksmoke",
--primaryCEG,
--"custom:skyhatelaser",
"custom:blood_spray",
},
},
buildoptions = Shared.buildListZaal,
sounds = {
underattack = "other/unitsunderattack1",
select = {
"other/gdmex",
"other/gdfactoryselect",
},
},
weapons = {
@@ -87,20 +71,17 @@ unitDef = {
ProvideTech = techprovided,
unittype = "building",
metal_extractor = metalMultiplier,
supply_granted = supplygranted,
iseco = 1,
needed_cover = 3,
death_sounds = "generic",
armortype = armortype,
noenergycost = true,
normaltex = "unittextures/zhive_normals.dds",
factionname = "zaal",
--corpse = "energycore",
helptext = [[]],
customgrounddecal = true,
armortype = "building",
normaltex = "unittextures/zhive_normals.dds",
factionname = "zaal",
corpse = "energycore",
},
--useGroundDecal = true,
--BuildingGroundDecalType = "chickengroundplate.dds",
--BuildingGroundDecalSizeX = 18,
--BuildingGroundDecalSizeY = 18,
--BuildingGroundDecalDecaySpeed = 0.9,
}
useGroundDecal = false,
BuildingGroundDecalType = "factorygroundplate.dds",
BuildingGroundDecalSizeX = 26,
BuildingGroundDecalSizeY = 26,
BuildingGroundDecalDecaySpeed = 0.9,
}

0 comments on commit cea4340

Please sign in to comment.
You can’t perform that action at this time.