Esempio n. 1
0
func DoInit(int first_player)
{
	ClearFreeRect(530,1135, 50,2);
	// Start Intro.
	StartSequence("Intro", 0, g_flagpole);
	return true;
}
Esempio n. 2
0
func DoInit(int first_player)
{
	var relaunch_rule = GetRelaunchRule();
	relaunch_rule->SetInventoryTransfer(true);
	relaunch_rule->SetFreeCrew(true);
	relaunch_rule->SetRespawnDelay(1);
	relaunch_rule->SetBaseRespawn(true);
	relaunch_rule->SetDefaultRelaunchCount(nil);
	relaunch_rule->SetAllowPlayerRestart(true);
	relaunch_rule->SetLastClonkRespawn(true);
	relaunch_rule->SetInitialRelaunch(false);
	ClearFreeRect(530,1135, 50,2);
	if (g_last_stone_door) g_last_stone_door->DoDamage(170 - g_last_stone_door->GetDamage());
	if (g_golden_idol)
	{
		g_golden_idol->SetLightRange(150,15);
		g_golden_idol->SetLightColor(0xffc000);
	}
	if (g_golden_shovel)
	{
		g_golden_shovel->SetLightRange(25,15);
		g_golden_shovel->SetLightColor(0xffc000);
	}
	npc_dagobert->SetAlternativeSkin("Beggar");
	// Start Intro.
	StartSequence("Intro", 0, g_flagpole);
	return true;
}
Esempio n. 3
0
func DoInit(int first_player)
{
	// Message when first player enters shroom area
	ScheduleCall(nil, Scenario.ShroomCaveCheck, 21, 0xffffff);
	// Scorching village
	g_ruin1->AddScorch(-20,-10, -45, 50, 1500);
	g_ruin2->AddScorch(-15,42, 90, 50, 1200);
	g_ruin3->AddScorch(-12,18, 130, 80, 1300);
	// Horax
	g_king.JumpSpeed = 200;
	// Update AI stuff
	var fx;
	for (var enemy in FindObjects(Find_ID(Clonk), Find_Owner(NO_OWNER)))
		if (fx = S2AI->GetAI(enemy))
		{
			fx.weapon = fx.target = nil;
			S2AI->BindInventory(enemy);
			enemy->DoEnergy(10000);
			enemy->AddEnergyBar();
		}
	g_farmer.portrait = { Source=DialogueCastle };
	// Start intro if not yet started
	StartSequence("Intro", 0, GetCrew(first_player));
	return true;
}
Esempio n. 4
0
func Dlg_Book_Mystery(object player)
{
	DlgText("$DlgBookMystery01$", player);
	DlgText("$DlgBookMystery02$");
	DlgText("$DlgBookMystery03$", player);
	if (DlgEvent())
	{
		StartSequence("Rift_Appear", 0, player);
		ScheduleCall(this, this.Dlg_Book_Mystery_Remove, 2);
	}
}
Esempio n. 5
0
// make the entity enter a scripted sequence
void CCineMonster::PossessEntity(void)
{
	CBaseEntity * pEntity = m_hTargetEnt;
	CBaseMonster *pTarget = NULL;
	if(pEntity)
		pTarget = pEntity->MyMonsterPointer();

	if(pTarget)
	{
// FindEntity() just checked this!
#if 0
		if ( !pTarget->CanPlaySequence(  FCanOverrideState() ) )
		{
			ALERT( at_aiconsole, "Can't possess entity %s\n", STRING(pTarget->pev->classname) );
			return;
		}
#endif

		pTarget->m_pGoalEnt   = this;
		pTarget->m_pCine      = this;
		pTarget->m_hTargetEnt = this;

		m_saved_movetype = pTarget->pev->movetype;
		m_saved_solid    = pTarget->pev->solid;
		m_saved_effects  = pTarget->pev->effects;
		pTarget->pev->effects |= pev->effects;

		switch(m_fMoveTo)
		{
		case 0:
			pTarget->m_scriptState = SCRIPT_WAIT;
			break;

		case 1:
			pTarget->m_scriptState = SCRIPT_WALK_TO_MARK;
			DelayStart(1);
			break;

		case 2:
			pTarget->m_scriptState = SCRIPT_RUN_TO_MARK;
			DelayStart(1);
			break;

		case 4:
			UTIL_SetOrigin(pTarget->pev, pev->origin);
			pTarget->pev->ideal_yaw = pev->angles.y;
			pTarget->pev->avelocity = Vector(0, 0, 0);
			pTarget->pev->velocity  = Vector(0, 0, 0);
			pTarget->pev->effects |= EF_NOINTERP;
			pTarget->pev->angles.y = pev->angles.y;
			pTarget->m_scriptState = SCRIPT_WAIT;
			m_startTime            = gpGlobals->time + 1E6;
			// UNDONE: Add a flag to do this so people can fixup physics after teleporting monsters
			//			pTarget->pev->flags &= ~FL_ONGROUND;
			break;
		}
		//		ALERT( at_aiconsole, "\"%s\" found and used (INT: %s)\n", STRING( pTarget->pev->targetname ), FBitSet(pev->spawnflags, SF_SCRIPT_NOINTERRUPT)?"No":"Yes" );

		pTarget->m_IdealMonsterState = MONSTERSTATE_SCRIPT;
		if(m_iszIdle)
		{
			StartSequence(pTarget, m_iszIdle, FALSE);
			if(FStrEq(STRING(m_iszIdle), STRING(m_iszPlay)))
			{
				pTarget->pev->framerate = 0;
			}
		}
	}
}
Esempio n. 6
0
public func Dlg_Iolo(object player)
{
	var has_dialogue_arrow = player.dialogue_iolo_arrow
	                     && !player.dialogue_iolo_has_arrow;
	                     
	var has_dialogue_elevator = GetActiveSequence()
		                     && GetActiveSequence().seq_name == "Iolo_Elevator";
		                     
	var has_dialogue_iolo = player.dialogue_guardsman_elevator // same as in Iolo's father dialogue
	                    && !player.dialogue_iolo_arrow;  // talked to guardsman about the elevator

	
	                     
	if (has_dialogue_arrow)
	{
		var arrows = player->FindContents(BombArrow);
		DlgText("$DlgIoloA01$");
		if (arrows)
		{
			DlgText("$DlgIoloA02$", player);
			DlgText("$DlgIoloA03$");
			if (DlgEvent())
			{
				arrows->RemoveObject();
				player.dialogue_iolo_has_arrow = true;
				StartSequence("Iolo_Elevator", 0, this, player);
			}
		}
		else
		{
			DlgText("$DlgIoloA04$", player);
		}
	}
	else if (has_dialogue_elevator)
	{
		DlgText("$DlgIoloB01$");
		DlgText("$DlgIoloB02$", player);
		if (DlgEvent())
		{
			StopSequence();
		}
	}
	else if (has_dialogue_iolo)
	{
		var in_sequence = GetActiveSequence()
		               && GetActiveSequence().seq_name == "Iolo_Comes";
		if (!in_sequence)
		{
			DlgText("$DlgIoloC01$");
			// from father dialoge
			DlgText("$DlgIoloFatherA10$", player);
			DlgText("$DlgIoloFatherA11$", player);
			DlgText("$DlgIoloFatherA12$", player);
			DlgText("$DlgIoloFatherA13$");
			// end of father dialoge
			DlgText("$DlgIoloC02$");
			if (DlgEvent())
			{
				StartSequence("Iolo_Comes", 0, this, player, true);
			}
		}
		else
		{
			DlgText("$DlgIoloC03$");
			if (DlgEvent())
			{
				player.dialogue_iolo_arrow = true;
				StopSequence();
			}
		}
	}
	else
	{
		DlgText("$DlgIoloD01$");
		DlgText("$DlgIoloD02$", player);
		DlgText("$DlgIoloD03$");
	}
}
Esempio n. 7
0
public func Dlg_IolosFather(object player)
{
	var has_dialogue_iolo = player.dialogue_guardsman_elevator
	                    && !player.dialogue_iolo_arrow;  // talked to guardsman about the elevator

	var has_dialogue_crowbar = player.dialogue_pirat_get_quest == DIALOGUE_Pirat_QuestWaiting
	                       && !player.dialogue_carpenter_crowbar
	                       && !player.dialogue_iolos_father_angry;

	var has_final_dialogue = player.dialogue_iolos_father_angry;

	if (has_dialogue_iolo)
	{
		var in_sequence = GetActiveSequence()
		               && GetActiveSequence().seq_name == "Iolo_Comes";
		if (!in_sequence)
		{
			DlgText("$DlgIoloFatherA01$", player);
			DlgText("$DlgIoloFatherA02$");
			DlgText("$DlgIoloFatherA03$");
			DlgText("$DlgIoloFatherA04$");
			DlgText("$DlgIoloFatherA05$");
			DlgText("$DlgIoloFatherA06$");
			DlgText("$DlgIoloFatherA07$");
			if (DlgEvent())
			{
				StartSequence("Iolo_Comes", 0, this, player, false);
			}
		}
		else
		{
			DlgText("$DlgIoloFatherA08$", npc_iolo);
			DlgText("$DlgIoloFatherA09$");
			DlgText("$DlgIoloFatherA10$", player);
			DlgText("$DlgIoloFatherA11$", player);
			DlgText("$DlgIoloFatherA12$", player);
			DlgText("$DlgIoloFatherA13$", npc_iolo);		
			if (DlgEvent())
			{
				player.dialogue_iolo_arrow = true;
				StopSequence();
			}
		}
	}
	else if (has_dialogue_crowbar)
	{
		DlgText("$DlgIoloFatherB01$", player);
		DlgText("$DlgIoloFatherB02$");
		if (DlgEvent())
		{
			player.dialogue_iolos_father_angry = true;
		}
	}
	else if (has_final_dialogue)
	{
		DlgText("$DlgIoloFatherB03$");
	}
	else // default dialogue
	{
		DlgText("$DlgIoloFatherB04$", player);
		DlgText("$DlgIoloFatherB05$");
	}
}
Esempio n. 8
0
// make the entity enter a scripted sequence
void CCineMonster::PossessEntity( void )
{
	CBaseEntity		*pEntity = m_hTargetEnt;
	CBaseMonster	*pTarget = NULL;
	if( pEntity )
		pTarget = pEntity->MyMonsterPointer();

	if( pTarget )
	{

		// FindEntity() just checked this!
#if 0
		if( !pTarget->CanPlaySequence( FCanOverrideState() ) )
		{
			ALERT( at_aiconsole, "Can't possess entity %s\n", pTarget->GetClassname() );
			return;
		}
#endif

		pTarget->m_hGoalEnt = this;
		pTarget->m_pCine = this;
		pTarget->m_hTargetEnt = this;

		m_saved_movetype = pTarget->GetMoveType();
		m_saved_solid = pTarget->GetSolidType();
		m_saved_effects = pTarget->GetEffects();
		pTarget->GetEffects() |= GetEffects();

		switch( m_fMoveTo )
		{
		case 0:
			pTarget->m_scriptState = SCRIPT_WAIT;
			break;

		case 1:
			pTarget->m_scriptState = SCRIPT_WALK_TO_MARK;
			DelayStart( true );
			break;

		case 2:
			pTarget->m_scriptState = SCRIPT_RUN_TO_MARK;
			DelayStart( true );
			break;

		case 4:
			pTarget->SetAbsOrigin( GetAbsOrigin() );
			pTarget->SetIdealYaw( GetAbsAngles().y );
			pTarget->SetAngularVelocity( g_vecZero );
			pTarget->SetAbsVelocity( Vector( 0, 0, 0 ) );
			pTarget->GetEffects() |= EF_NOINTERP;
			Vector vecAngles = pTarget->GetAbsAngles();
			vecAngles.y = GetAbsAngles().y;
			pTarget->SetAbsAngles( vecAngles );
			pTarget->m_scriptState = SCRIPT_WAIT;
			m_startTime = gpGlobals->time + 1E6;
			// UNDONE: Add a flag to do this so people can fixup physics after teleporting monsters
			//			pTarget->GetFlags().ClearFlags( FL_ONGROUND );
			break;
		}
		//		ALERT( at_aiconsole, "\"%s\" found and used (INT: %s)\n", pTarget->GetTargetname(), GetSpawnFlags().Any( SF_SCRIPT_NOINTERRUPT ) ?"No":"Yes" );

		pTarget->m_IdealMonsterState = MONSTERSTATE_SCRIPT;
		if( m_iszIdle )
		{
			StartSequence( pTarget, m_iszIdle, false );
			if( FStrEq( STRING( m_iszIdle ), STRING( m_iszPlay ) ) )
			{
				pTarget->SetFrameRate( 0 );
			}
		}
	}
}