File: Easteregg.c

package info (click to toggle)
openclonk 8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 169,656 kB
  • sloc: cpp: 180,484; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 148; sh: 101; javascript: 34
file content (39 lines) | stat: -rw-r--r-- 1,057 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// The wipf will produce pink bubbles when eating a berry.

#appendto Wipf


protected func RejectCollect(id object_id)
{
	if (object_id == Sproutberry)
	{
		// Add some stars effect to the clonk indicating the easteregg.
		CreateParticle("StarSpark", PV_Random(-3, 3), PV_Random(-14, -10), PV_Random(-5, 5), PV_Random(-8, 0), 25, Particles_Magic(), 20);
		// Add the bubbles effect for the wipf.
		AddEffect("IntBreathBubbles", this, 100, 5, this);
		// Achievement: easter egg found.
		GainScenarioAchievement("TutorialEasterEgg");
	}
	return _inherited(object_id, ...);	
}

protected func FxIntBreathBubblesTimer(object target, proplist effect, int time)
{
	if (!Random(4))
		return FX_OK;
		
	var bubble = 
	{
		CollisionVertex = 500,
		OnCollision = PC_Die(),
		ForceY = PV_Gravity(-100),
		ForceX = PV_Wind(100),
		DampingX = 900, DampingY = 900,
		Alpha = PV_Linear(255, 0),
		R = 255, G = 20, B = 147,
		Size = 3,
		Phase = 0
	};	
	CreateParticle("SphereSpark", 3 * GetDir(), -2, PV_Random(-2, 2), PV_Random(-8, 0), 25, bubble, 1);	
	return FX_OK;
}