Exemple #1
0
func Initialize()
{
	// Goal
	var goal = FindObject(Find_ID(Goal_RepairStatue));
	if (!goal) goal = CreateObject(Goal_RepairStatue);
	var statue = CreateObject(MinersStatue, 600,736);
	statue->SetBroken();
	var statue_head = CreateObject(MinersStatue_Head, 2200,560);
	goal->SetStatue(statue);
	// Rules
	if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount);
	if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObject(Rule_BuyAtFlagpole);
	// Mushrooms before any earth materials, because they create their own caves
	LargeCaveMushroom->Place(15, Rectangle(100,0,600,300));
	// Create earth materials
	// Create them in big clusters so the whole object arrangement looks a bit less uniform and more interesting
	PlaceBatches([Firestone], 5, 100, 10);
	PlaceBatches([Rock, Loam, Loam], 10, 200, 10);
	// Misc vegetation
	SproutBerryBush->Place(5, Rectangle(100,0,600,300));
	Mushroom->Place(5, Rectangle(100,0,600,300));
	// Sky
	SetSkyParallax(1, 20,20, 0,0, nil, nil);
	return true;
}
Exemple #2
0
protected func Initialize()
  {
  // Sicherstellen, dass das Spielziel da ist
  if (!ObjectCount(_KTK)) CreateObject(_KTK,0,0,-1);
  // Zusätzlich Melee
  if (!ObjectCount(MELE)) CreateObject(MELE);
  // Himmelsparallaxität
  SetSkyParallax(0,20,10);
  // Script starten
  ScriptGo(1);
  // Fertig
  return(1);
  }
Exemple #3
0
func Initialize()
{
	// Goal
	var goal = FindObject(Find_ID(Goal_SellGems));
	if (!goal) goal = CreateObject(Goal_SellGems);
	goal->SetTargetAmount(30);
	// Rules
	if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount);
	if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObject(Rule_BuyAtFlagpole);
	// Environment
	SetSkyParallax(1, 20,20, 0,0, nil, nil);
	return true;
}
Exemple #4
0
func Initialize()
{
	// Always have some music
	Music("Frontend", 1);
	MusicLevel(30);
	// Create lens flare
	if (!ObjectCount(LENS)) CreateObject(LENS, 400, 100);
	// Fix vines (are not correctly saved in this Objects.txt)
	var pVine;
	for (pVine in FindObjects(Find_ID(VINE)))
		pVine->SetPosition(pVine->GetX(), pVine->GetY() - 35);
	// Create goal
	if (!ObjectCount(SCRG)) CreateObject(SCRG);
	// Evaluation dialog options
  SetNextMission("Tutorial.c4f\\Tutorial05.c4s", "$BtnRepeatRound$", "$BtnRepeatRoundDesc$");
}
protected func Initialize()
{	
	// Under no circumstance there may by multiple copies of this rule.
	if (ObjectCount(Find_ID(Rule_Gravestones)) > 1)
		return RemoveObject();
	return;
}
Exemple #6
0
global func CreateBurnMark(int iX, int iY, int iLevel, int Count) 
{
  var boom;
  if(!ObjectCount(BOOM)) boom = CreateObject(BOOM,0,0,-1);
  else boom = FindObject(BOOM);
  
  var angle=Random(360/Count); //variablen für die überprüfung
  var type;
  for(var z; z < Count; z++)
	{
    angle += Max(1,360/Count);

    // Check: Sky or Solid/Liquid
    var x = iX+Cos(angle,iLevel);
    var y = iY+Sin(angle,iLevel);
    if((GetMaterialVal("Density","Material",GetMaterial(x,y)) != 0) || (GetMaterial(x,y) == -1))
      continue;

    type = 1+Random(3);
    var size = BurnMarkCheck(angle,RandomX(iLevel/2,iLevel*2),iX,iY);
    var sin = Sin(angle,(size-iLevel)/2+iLevel+Random(3));
    var cos = Cos(angle,(size-iLevel)/2+iLevel+Random(3));

    CreateParticle("BurnMark",iX+cos,iY+sin,Cos(angle+RandomX(-5,5),50),Sin(angle+RandomX(-5,5),50),size*5+Random(25),RGBa(0,0,0,64),boom,1); 
  }
}
Exemple #7
0
global func FxCheckForFlagTimer(pTarget, iEffectNumber) {
	// Lost the flag?
	if (!ObjectCount(FLAG))
		// Relaunch!
		GameCall("RelaunchPlayer", GetPlayerByIndex());
	return(1);
}
Exemple #8
0
void HUDShowObjTally (void)
{
	static int		objCounts [2] = {0, 0};
	static time_t	t0 = -1;
	static int		nIdTally [2] = {0, 0};
	time_t			t;

if (!gameOpts->render.cockpit.bObjectTally)
	return;
if (HIDE_HUD)
	return;
if (!IsMultiGame || IsCoopGame) {
	int	x, x0 = 0, y = 0, w, h, aw, i, bmW, bmH;
	char	szInfo [20];

	if (gameStates.render.cockpit.nMode == CM_FULL_COCKPIT)
		y = 3 * nHUDLineSpacing;
	else if (gameStates.render.cockpit.nMode == CM_STATUS_BAR)
		y = 2 * nHUDLineSpacing;
	else {//if (!SHOW_COCKPIT) {
		y = 2 * nHUDLineSpacing;
		if (gameStates.render.fonts.bHires)
			y += nHUDLineSpacing;
		}
	if (gameOpts->render.cockpit.bPlayerStats)
		y += 2 * nHUDLineSpacing;

	x0 = grdCurCanv->cv_w;
	GrSetFontColorRGBi (GREEN_RGBA, 1, 0, 0);
	t = gameStates.app.nSDLTicks;
	if (t - t0 > 333) {	//update 3 times per second
		t0 = t;
		for (i = 0; i < 2; i++) 
			objCounts [i] = ObjectCount (i ? OBJ_POWERUP : OBJ_ROBOT);
		}
	if (!gameOpts->render.cockpit.bTextGauges && (LoadObjTallyIcons () > 0)) {
		for (i = 0; i < 2; i++) {
			bmH = bmObjTally [i].bmProps.h / 2;
			bmW = bmObjTally [i].bmProps.w / 2;
			x = x0 - bmW - HUD_LHX (2);
			OglUBitMapMC (x, y, bmW, bmH, bmObjTally + i, NULL, F1_0, 0);
			sprintf (szInfo, "%d", objCounts [i]);
			GrGetStringSize (szInfo, &w, &h, &aw);
			x -= w + HUD_LHY (2);
			nIdTally [i] = GrPrintF (nIdTally + i, x, y + (bmH - h) / 2, szInfo);
			y += bmH;
			}
		}
	else {
		y = 6 + 3 * nHUDLineSpacing;
		for (i = 0; i < 2; i++) {
			sprintf (szInfo, "%s: %5d", i ? "Powerups" : "Robots", objCounts [i]);
			GrGetStringSize (szInfo, &w, &h, &aw);
			nIdTally [i] = GrPrintF (nIdTally + i, grdCurCanv->cv_w - w - HUD_LHX (2), y, szInfo);
			y += nHUDLineSpacing;
			}
		}
	}
}
func Initialize()
{
	if (ObjectCount(Find_ID(Rule_EnergyBarsAboveStructures)) > 0)
	{
		if (this.HitPoints != nil)
			AddEnergyBar();
	}
	return _inherited(...);
}
Exemple #10
0
public func IsFulfilled()
{
  // Gold noch nicht gezählt?
  var GoldCnt = GetMaterialCount(Material("Gold"));
  if (GoldCnt == -1) return();
  // Noch zu viel?
  if (GoldCnt >= 150) return();
  // Noch Goldstücke abzubauen?
  return(!ObjectCount(GOLD));
}
Exemple #11
0
func Initialize()
{
	if(ObjectCount(Find_ID(GetID()), Find_Exclude(this)))
	{
		(FindObject(Find_ID(GetID()), Find_Exclude(this)).maxkills) += 2;
		return RemoveObject();
	}
	maxkills = GameCall("WinKillCount");
	if(maxkills == nil || maxkills < 1) maxkills = 4;
	return _inherited(...);
}
Exemple #12
0
StdStrBuf C4ObjectList::GetDataString()
{
	StdStrBuf Output;

	// Compose info text by selected object(s)
	switch (ObjectCount())
	{
		// No selection
	case 0:
		Output = LoadResStr("IDS_CNS_NOOBJECT");
		break;
		// One selected object
	case 1:
		Output.Take(GetObject()->GetDataString());
		break;
	// Multiple selected objects
	default:
		Output.Format(LoadResStr("IDS_CNS_MULTIPLEOBJECTS"),ObjectCount());
		break;
	}
	return Output;
}
func Initialize()
{
	// Goal
	var goal = FindObject(Find_ID(Goal_SellGems));
	if (!goal) goal = CreateObject(Goal_SellGems);
	goal->SetTargetAmount(10);
	// Rules
	if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount);
	if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObject(Rule_BuyAtFlagpole);
	// Mushrooms before any earth materials, because they create their own caves
	LargeCaveMushroom->Place(15, Rectangle(400,0,800,200));
	// Create earth materials
	// Create them in big clusters so the whole object arrangement looks a bit less uniform and more interesting
	PlaceBatches([Firestone], 3, 100, 5);
	PlaceBatches([Rock, Loam, Loam], 10, 200, 10);
	// Misc vegetation
	SproutBerryBush->Place(5, Rectangle(350,0,850,250));
	Mushroom->Place(5, Rectangle(350,0,850,250));
	// Sky
	SetSkyParallax(1, 20,20, 0,0, nil, nil);
	return true;
}
Exemple #14
0
global func FxFireStart(object obj, int iNumber, int iTemp, int iCausedBy, bool fBlasted, object pIncineratingObject)
  {
  // Wenn ein Objekt zu brennen beginnt, gleich das Löschen planen
  var i;
  if (!iTemp) if (GetAlive(obj)) if (i=ObjectCount(_ETG))
    {
    // Lösche in Schlüsselframes, damit nahe beieinanderliegende Objekte ungefähr gleichzeitig gelöscht werden
    // Dies verringert die Chance des Neuanzündens
    var iExtgTime = 200/i + 50 - (FrameCounter() % 50);
    AddEffect("IntExtinguisher", obj, 1, iExtgTime, obj);
    }
  return(inherited(obj, iNumber, iTemp, iCausedBy, fBlasted, pIncineratingObject));
  }
Exemple #15
0
func Create()
{
	Zahl++;
	if(Zahl > 200 - GetPlayerCount()*10) Zahl = 1;
	if(Can && Zahl == 1) 
	{
	    if(ObjectCount(ZCLK) > 100 * GetPlayerCount()) return();
	    var pZombie;
	    pZombie = CreateObject(ZCLK,0,0,-1);
	    pZombie -> SetColorDw(HSL(Random(256),255,127));
    	pZombie -> Zombize();
    	pZombie -> SetComDir(COMD_Left);
    }
}
Exemple #16
0
StdStrBuf C4ObjectList::GetNameList(C4DefList &rDefs) const
{
	int cpos,idcount;
	C4ID c_id;
	C4Def *cdef;
	StdStrBuf Buf;
	for (cpos=0; (c_id=GetListID(C4D_All,cpos)); cpos++)
		if ((cdef=rDefs.ID2Def(c_id)))
		{
			idcount=ObjectCount(c_id);
			if (cpos>0) Buf.Append(", ");
			Buf.AppendFormat("%dx %s",idcount,cdef->GetName());
		}
	return Buf;
}
Exemple #17
0
public func GetDescription(int plr)
{
	// Count active enemy clonks.
	var hostile_count = ObjectCount(Find_OCF(OCF_CrewMember), Find_NoContainer(), Find_Hostile(plr));
	var message;
	if (!hostile_count)
		message = "$MsgGoalFulfilled$";
	else
		message = Format("$MsgGoalUnfulfilled$", hostile_count);

	// Also report the remaining rounds.
	message = Format("%s|%s", message, CurrentRoundStr());

	return message;
}
Exemple #18
0
void C4ObjectList::CompileFunc(StdCompiler *pComp, bool fSkipPlayerObjects, C4ValueNumbers * numbers)
{
	// "Object" section count
	int32_t iObjCnt = ObjectCount();
	pComp->Value(mkNamingCountAdapt(iObjCnt, "Object"));
	if (pComp->isDecompiler())
	{
		// skipping player objects would screw object counting in non-naming compilers
		assert(!fSkipPlayerObjects || pComp->hasNaming());
		// Decompile all objects in reverse order
		for (C4ObjectLink *pPos = Last; pPos; pPos = pPos->Prev)
			if (pPos->Obj->Status)
				if (!fSkipPlayerObjects || !pPos->Obj->IsUserPlayerObject())
					pComp->Value(mkNamingAdapt(mkParAdapt(*pPos->Obj, numbers), "Object"));
	}
	else
	{
		// FIXME: Check that no PlayerObjects are loaded when fSkipPlayerObjects is true
		// i.e. that loading and saving was done with the same flag.
		// Remove previous data
		Clear();
		// Load objects, add them to the list.
		for (int i = 0; i < iObjCnt; i++)
		{
			C4Object *pObj = NULL;
			try
			{
				pComp->Value(mkNamingAdapt(mkParAdapt(mkPtrAdaptNoNull(pObj), numbers), "Object"));
				Add(pObj, stReverse);
			}
			catch (StdCompiler::Exception *pExc)
			{
				// Failsafe object loading: If an error occurs during object loading, just skip that object and load the next one
				if (!pExc->Pos.getLength())
					LogF("ERROR: Object loading: %s", pExc->Msg.getData());
				else
					LogF("ERROR: Object loading(%s): %s", pExc->Pos.getData(), pExc->Msg.getData());
				delete pExc;
			}
		}
	}
}
Exemple #19
0
global func FxPotionSupplyTimer(pTarget)
{
  if(!Random(50) || GetCon(pTarget) !=100) return();
	var i,p;
	for(i=0; i<ObjectCount(0,0,0,0,0,0,0,0,pTarget); ++i)
	{
		if(Contents(i, pTarget)->~IsPotion()) p++;
	}
	if(p>3) return(0);
  var rnd=Random(8);
  if(!rnd--) if(!FindContents(PFIR, pTarget)) CreateContents(PFIR, pTarget);
  if(!rnd--) if(!FindContents(PFIS, pTarget)) CreateContents(PFIS, pTarget);
  if(!rnd--) if(!FindContents(PHEA, pTarget)) CreateContents(PHEA, pTarget);
  if(!rnd--) if(!FindContents(PIMM, pTarget)) CreateContents(PIMM, pTarget);
  if(!rnd--) if(!FindContents(PMAN, pTarget)) CreateContents(PMAN, pTarget);
  if(!rnd--) if(!FindContents(PMON, pTarget)) CreateContents(PMON, pTarget);
  if(!rnd--) if(!FindContents(PSTO, pTarget)) CreateContents(PSTO, pTarget);
  if(!rnd--) if(!FindContents(PWIP, pTarget)) CreateContents(PWIP, pTarget);
  return(1);
}  
Exemple #20
0
int C4GameObjects::Load(C4Group &hGroup, bool fKeepInactive) {
  Clear(!fKeepInactive);

  // Load data component
  StdStrBuf Source;
  if (!hGroup.LoadEntryString(C4CFN_ScenarioObjects, Source)) return 0;

  // Compile
  StdStrBuf Name = hGroup.GetFullName() + DirSep C4CFN_ScenarioObjects;
  if (!CompileFromBuf_LogWarn<StdCompilerINIRead>(mkParAdapt(*this, false),
                                                  Source, Name.getData()))
    return 0;

  // Process objects
  C4ObjectLink *cLnk = nullptr;
  C4Object *pObj = nullptr;
  bool fObjectNumberCollision = false;
  int32_t iMaxObjectNumber = 0;
  for (cLnk = Last; cLnk; cLnk = cLnk->Prev) {
    C4Object *pObj = cLnk->Obj;
    // check object number collision with inactive list
    if (fKeepInactive) {
      for (C4ObjectLink *clnk = InactiveObjects.First; clnk; clnk = clnk->Next)
        if (clnk->Obj->Number == pObj->Number) fObjectNumberCollision = true;
    }
    // keep track of numbers
    iMaxObjectNumber = Max<long>(iMaxObjectNumber, pObj->Number);
    // add to list of backobjects
    if (pObj->Category & C4D_Background)
      Game.BackObjects.Add(pObj, C4ObjectList::stMain, this);
    // add to list of foreobjects
    if (pObj->Category & C4D_Foreground)
      Game.ForeObjects.Add(pObj, C4ObjectList::stMain, this);
    // Unterminate end
  }

  // Denumerate pointers
  // if object numbers collideded, numbers will be adjusted afterwards
  // so fake inactive object list empty meanwhile
  C4ObjectLink *pInFirst = nullptr;
  if (fObjectNumberCollision) {
    pInFirst = InactiveObjects.First;
    InactiveObjects.First = NULL;
  }
  // denumerate pointers
  Denumerate();
  // update object enumeration index now, because calls like UpdateTransferZone
  // might create objects
  Game.ObjectEnumerationIndex =
      Max(Game.ObjectEnumerationIndex, iMaxObjectNumber);
  // end faking and adjust object numbers
  if (fObjectNumberCollision) {
    InactiveObjects.First = pInFirst;
    // simply renumber all inactive objects
    for (cLnk = InactiveObjects.First; cLnk; cLnk = cLnk->Next)
      if ((pObj = cLnk->Obj)->Status)
        pObj->Number = ++Game.ObjectEnumerationIndex;
  }

  // special checks:
  // -contained/contents-consistency
  // -StaticBack-objects zero speed
  for (cLnk = First; cLnk; cLnk = cLnk->Next)
    if ((pObj = cLnk->Obj)->Status) {
      // staticback must not have speed
      if (pObj->Category & C4D_StaticBack) {
        pObj->xdir = pObj->ydir = 0;
      }
      // contained must be in contents list
      if (pObj->Contained)
        if (!pObj->Contained->Contents.GetLink(pObj)) {
          DebugLogF(
              "Error in Objects.txt: Container of #%d is #%d, but not found in "
              "contents list!",
              pObj->Number, pObj->Contained->Number);
          pObj->Contained->Contents.Add(pObj, C4ObjectList::stContents);
        }
      // all contents must have contained set; otherwise, remove them!
      C4Object *pObj2;
      for (C4ObjectLink *cLnkCont = pObj->Contents.First; cLnkCont;
           cLnkCont = cLnkCont->Next) {
        // check double links
        if (pObj->Contents.GetLink(cLnkCont->Obj) != cLnkCont) {
          DebugLogF("Error in Objects.txt: Double containment of #%d by #%d!",
                    cLnkCont->Obj->Number, pObj->Number);
          // this remove-call will only remove the previous (dobuled) link, so
          // cLnkCont should be save
          pObj->Contents.Remove(cLnkCont->Obj);
          // contents checked already
          continue;
        }
        // check contents/contained-relation
        if ((pObj2 = cLnkCont->Obj)->Status)
          if (pObj2->Contained != pObj) {
            DebugLogF(
                "Error in Objects.txt: Object #%d not in container #%d as "
                "referenced!",
                pObj2->Number, pObj->Number);
            pObj2->Contained = pObj;
          }
      }
    }
  // sort out inactive objects
  C4ObjectLink *cLnkNext;
  for (cLnk = First; cLnk; cLnk = cLnkNext) {
    cLnkNext = cLnk->Next;
    if (cLnk->Obj->Status == C4OS_INACTIVE) {
      if (cLnk->Prev)
        cLnk->Prev->Next = cLnkNext;
      else
        First = cLnkNext;
      if (cLnkNext)
        cLnkNext->Prev = cLnk->Prev;
      else
        Last = cLnk->Prev;
      if (cLnk->Prev = InactiveObjects.Last)
        InactiveObjects.Last->Next = cLnk;
      else
        InactiveObjects.First = cLnk;
      InactiveObjects.Last = cLnk;
      cLnk->Next = NULL;
      Mass -= pObj->Mass;
    }
  }

  {
    C4DebugRecOff DBGRECOFF;  // - script callbacks that would kill
                              // DebugRec-sync for runtime start
    // update graphics
    UpdateGraphics(false);
    // Update faces
    UpdateFaces(false);
    // Update ocf
    SetOCF();
  }

  // make sure list is sorted by category - after sorting out inactives, because
  // inactives aren't sorted into the main list
  FixObjectOrder();

  // Sectors.Dump();

  // misc updates
  for (cLnk = First; cLnk; cLnk = cLnk->Next)
    if ((pObj = cLnk->Obj)->Status) {
      // add to plrview
      pObj->PlrFoWActualize();
      // update flipdir (for old objects.txt with no flipdir defined)
      // assigns Action.DrawDir as well
      pObj->UpdateFlipDir();
    }
  // Done
  return ObjectCount();
}
Exemple #21
0
func Initialize()
{
	if(!ObjectCount(Find_ID(Rule_NoPowerNeed))) CreateObject(Rule_NoPowerNeed, 0, 0, NO_OWNER);
}
Exemple #22
0
global func DoInitialize() {
    if(fInitialized) return();
    fInitialized = 1;
    fUseHungerThirst = 1;

    if(!FindObject(NOPC)) CreateObject(NOPC);

    if(fUseHungerThirst) if (!ObjectCount(NDWA)) CreateObject(NDWA, 50,50, -1); // Durst
    if(fUseHungerThirst) if (!ObjectCount(NDFO)) CreateObject(NDFO, 50,50, -1); // Hunger

    if(FindObject(_ETG)) RemoveObject(FindObject(_ETG));
    if(FindObject(REPR)) RemoveObject(FindObject(REPR));
    CreateObject(REPR, 50,50, -1); // Nachwuchs
    if(FindObject(TREP)) RemoveObject(FindObject(TREP));
    CreateObject(TREP, 50,50, -1); // Baumnachwuchs

    // NPC's sollen Position halten
    var i, pObj;
    while(pObj = FindObjectOwner(0,-1,0,0,0,0,OCF_CrewMember,0,0,pObj))
        AddEffect("StayThere",pObj,1,35,pObj);

//  if (!GetPlayerCount()) return();
    // Banditen erstellen
    pObj = CreateObject(BNDT, 3917, 570, -1);
    pObj->SetAI("BanditNoMove", 3);
    pObj->SetColorDw(RGB(150));
    pObj = CreateObject(BNDT, 4120, 560, -1);
    pObj->SetAI("BanditNoMove", 3);
    pObj->SetColorDw(RGB(150));
    pObj = CreateObject(BNDT, 4175, 520, -1);
    pObj->SetAI("BanditNoMove", 3);
    pObj->SetColorDw(RGB(150));
    pObj = CreateObject(BNDT, 4044, 477, -1);
    pObj->SetAI("BanditNoMove", 3);
    pObj->SetColorDw(RGB(150));
    pObj = CreateObject(BNDT, 4309, 471, -1);
    pObj->SetAI("BanditBoss", 3);
    pObj->SetColorDw(RGB(150));
    pObj->MakeBoss();
    pObj->Enter(FindObject(MTNT, 4309, 471, -1, -1));
    // Startmaterial erstellen
    pWagon = CreateObject(COAC, 28, 270, -1);
    pHorse = CreateObject(HORS, 77, 270, -1);
    pHorse->ConnectWagon(pWagon);
    SetDir(1, pWagon);
    SetDir(1, pHorse);

    // Startmaterial
    CreateContents(MEAC,pWagon,6);
    CreateContents(WHKY,pWagon,3);
    for(i=0; i<2; i++) {
        pObj = CreateContents(WSKI, pWagon);
        LocalN("iWater", pObj) = 90;
        pObj->~UpdateGraphics();
    }
    CreateContents(MLLT,pWagon);
    CreateContents(KNFE,pWagon);
    CreateContents(IGNB,pWagon);
    CreateContents(DYNB,pWagon,2);
    CreateContents(METL,pWagon,7);
    CreateContents(WOOD,pWagon,21);
    CreateContents(CNKT,pWagon,4);
    CreateContents(LNKT,pWagon);

    // Höhle muss immer vom  Indianer zu betreten sein!
    FreeRect(1970,589,40,9);

    // Brauchbare Gebäude mit unzerstörbarkeit belegen
    for(pObj in FindObjects(Find_Category(C4D_StaticBack|C4D_Structure|C4D_Vehicle),Find_Not(Find_Category(32768)),Find_InRect(1130,190,300,140)))
        AddEffect("NoDmg",pObj,200);
    for(pObj in FindObjects(Find_Category(C4D_StaticBack|C4D_Structure|C4D_Vehicle),Find_Func("IsIndianHandcraft"),
                            Find_Or(Find_InRect(1830,230,560,340),Find_InRect(3190,160,670,360))))
        AddEffect("NoDmg",pObj,200);

    // Weil die Kanone hier bearbeitet worden ist
    if(pObj = FindObject(CCAN)) pObj->~Initialize();

    if(fTestSection==1) return(ChangeSection("AshCity"));
    if(fTestSection==2) return(ChangeSection("Caves"));

    // ... und los!
    if(!fTesting) ScriptGo(1);
    return(1);
}
Exemple #23
0
global func DoInitializeSection()
{
    if(g_iSection) if(fInitialized>g_iSection) return();
    fInitialized++;
    if(g_iSection==1)
    {
        if(!FindObject(NOPC)) CreateObject(NOPC);

        if(fUseHungerThirst) if (!ObjectCount(NDWA)) CreateObject(NDWA, 50,50, -1); // Durst
        if(fUseHungerThirst) if (!ObjectCount(NDFO)) CreateObject(NDFO, 50,50, -1); // Hunger

        if(FindObject(_ETG)) RemoveObject(FindObject(_ETG));
        if(FindObject(REPR)) RemoveObject(FindObject(REPR));
        CreateObject(REPR, 50,50, -1); // Nachwuchs
        if(FindObject(TREP)) RemoveObject(FindObject(TREP));
        CreateObject(TREP, 50,50, -1); // Baumnachwuchs

        // NPC's sollen Position halten
        var obj;
        while(obj = FindObjectOwner(0, -1, 0, 0, 0, 0, OCF_CrewMember(), 0, 0, obj))
            AddEffect("StayThere", obj, 1, 35, obj);

        // Energiebedarf erst verzögert
        if(FindObject(ENRG)) RemoveObject(FindObject(ENRG));
        Schedule("CreateObject(ENRG, 100, 100)", 500);

        // Aufzüge fixen
        FixElevator(FindObject(ELEV,1299, 292),176);
        FixElevator(FindObject(ELVB,1520,  71),165);
        FixElevator(FindObject(ELVB,1710, 241),150);
        FixElevator(FindObject(ELEV,2018,  81),209);
        FixElevator(FindObject(ELVB,2360, 291),260);

        // Banditen erzeugen
        var pBandit = CreateObject(BNDT, 1044, 260, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(INDI, 1103, 98, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1450, 298, -1);
        pBandit->SetAI("BanditRevolver", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1838, 259, -1);
        pBandit->SetAI("BanditRevolver", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1966, 190, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1634,  87, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        if(iDifficulty>1)
        {
            pBandit = CreateObject(BNDT, 1044, 318, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
            pBandit = CreateObject(BNDT, 1508, 259, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
            pBandit = CreateObject(BNDT, 1884, 79, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
//      pBandit = CreateObject(BNDT, 1627, 90, -1);
//      pBandit->SetAI("BanditNoMove", 3);
//      pBandit->SetColorDw(RGB(150));
            pBandit = CreateObject(BNDT, 2188, 309, -1);
            pBandit->SetAI("BanditRevolver", 3);
            pBandit->SetColorDw(RGB(150));
        }
    }
    if(g_iSection==2)
    {
        if(!FindObject(NOPC)) CreateObject(NOPC);

        if(fUseHungerThirst) if (!ObjectCount(NDWA)) CreateObject(NDWA, 50,50, -1); // Durst
        if(fUseHungerThirst) if (!ObjectCount(NDFO)) CreateObject(NDFO, 50,50, -1); // Hunger

        if(FindObject(_ETG)) RemoveObject(FindObject(_ETG));
        if(FindObject(REPR)) RemoveObject(FindObject(REPR));
        CreateObject(REPR, 50,50, -1); // Nachwuchs
        if(FindObject(TREP)) RemoveObject(FindObject(TREP));
        CreateObject(TREP, 50,50, -1); // Baumnachwuchs

        // NPC's sollen Position halten
        var obj;
        while(obj = FindObjectOwner(0, -1, 0, 0, 0, 0, OCF_CrewMember(), 0, 0, obj))
            AddEffect("StayThere", obj, 1, 35, obj);

        var obj;
        // Höhlenaufzüge brauchen keine Energie
        while( obj = FindObject(_CEL, 0, 0, 0, 0, 0, 0, 0, 0, obj))
            AddEffect("NoEnergyNeed", obj, 1, 1);
        // Banditen erzeugen
        var pBandit = CreateObject(BNDT, 1378, 115, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1703, 265, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1621, 330, -1);
        pBandit->SetAI("BanditRevolver", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1544, 169, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1904, 270, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 1827, 320, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit = CreateObject(BNDT, 2062, 318, -1);
        pBandit->SetAI("BanditNoMove", 3);
        pBandit->SetColorDw(RGB(150));
        pBandit->MakeBoss();
        if(iDifficulty>1)
        {
            pBandit = CreateObject(BNDT, 1381, 170, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
            pBandit = CreateObject(BNDT, 1703, 318, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
            pBandit = CreateObject(BNDT, 1412, 310, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
            pBandit = CreateObject(BNDT, 1622, 529, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
            pBandit = CreateObject(BNDT, 1019, 220, -1);
            pBandit->SetAI("BanditNoMove", 3);
            pBandit->SetColorDw(RGB(150));
        }
    }
}
Exemple #24
0
bool C4ObjectList::IsClear() const
{
	return (ObjectCount()==0);
}
Exemple #25
0
public func IsFulfilled () {
  var OilCnt = GetMaterialCount (Material ("Oil"));
  if (OilCnt == -1) return ();
  if (OilCnt >= 100) return ();
  return (!ObjectCount (OBRL));
}