Skip to content

Commit c383f54

Browse files
author
lofcz
committed
Rozšířeno player API
1 parent 462325b commit c383f54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+343
-10
lines changed

SimplexRPGEngine/Engine source/DragonRise3.project.gmx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@
513513
<sprite>sprites\sLetterEffect</sprite>
514514
<sprite>sprites\sQuestEffect</sprite>
515515
<sprite>sprites\sBoneEffect</sprite>
516+
<sprite>sprites\sKeyEffect</sprite>
516517
<sprite>sprites\sLockpickEffect</sprite>
517518
</sprites>
518519
<sprites name="Weapons">
@@ -608,6 +609,7 @@
608609
<sprite>sprites\sprite242</sprite>
609610
<sprite>sprites\sBarrel</sprite>
610611
<sprite>sprites\sprite244</sprite>
612+
<sprite>sprites\sEmoticons</sprite>
611613
</sprites>
612614
<backgrounds name="background">
613615
<backgrounds name=" Single tile backgrounds">
@@ -1165,6 +1167,8 @@
11651167
<object>objects\oLog</object>
11661168
<object>objects\oAreaScript</object>
11671169
<object>objects\oCopyright</object>
1170+
<object>objects\oExplosion</object>
1171+
<object>objects\oEmoticon</object>
11681172
<object>objects\oRoomConroller</object>
11691173
</objects>
11701174
<objects name="Effects">
@@ -1329,6 +1333,7 @@
13291333
<object>objects\oRelicLeftPart</object>
13301334
<object>objects\oRelicRightPart</object>
13311335
<object>objects\oRelic</object>
1336+
<object>objects\oKey</object>
13321337
<object>objects\oPouch</object>
13331338
<object>objects\oAlchemyDust</object>
13341339
<object>objects\oLofsGift</object>
@@ -1373,7 +1378,6 @@
13731378
<object>objects\parSolid</object>
13741379
</objects>
13751380
</objects>
1376-
<object>objects\oExplosion</object>
13771381
</objects>
13781382
<timelines name="timelines">
13791383
<timelines name="Cutscenes">
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
2+
<object>
3+
<spriteName>sEmoticons</spriteName>
4+
<solid>0</solid>
5+
<visible>-1</visible>
6+
<depth>-50</depth>
7+
<persistent>0</persistent>
8+
<parentName>&lt;undefined&gt;</parentName>
9+
<maskName>&lt;undefined&gt;</maskName>
10+
<events>
11+
<event eventtype="0" enumb="0">
12+
<action>
13+
<libid>1</libid>
14+
<id>603</id>
15+
<kind>7</kind>
16+
<userelative>0</userelative>
17+
<isquestion>0</isquestion>
18+
<useapplyto>-1</useapplyto>
19+
<exetype>2</exetype>
20+
<functionname></functionname>
21+
<codestring></codestring>
22+
<whoName>self</whoName>
23+
<relative>0</relative>
24+
<isnot>0</isnot>
25+
<arguments>
26+
<argument>
27+
<kind>1</kind>
28+
<string>/// Set up
29+
30+
image_speed = 0;
31+
</string>
32+
</argument>
33+
</arguments>
34+
</action>
35+
</event>
36+
<event eventtype="3" enumb="0">
37+
<action>
38+
<libid>1</libid>
39+
<id>603</id>
40+
<kind>7</kind>
41+
<userelative>0</userelative>
42+
<isquestion>0</isquestion>
43+
<useapplyto>-1</useapplyto>
44+
<exetype>2</exetype>
45+
<functionname></functionname>
46+
<codestring></codestring>
47+
<whoName>self</whoName>
48+
<relative>0</relative>
49+
<isnot>0</isnot>
50+
<arguments>
51+
<argument>
52+
<kind>1</kind>
53+
<string>/// Animate
54+
55+
image_alpha = lerp(image_alpha, 0, spd);
56+
y = lerp(y, ystart - 40, spd * 2);
57+
58+
if (image_alpha &lt; 0.02) {instance_destroy();}
59+
</string>
60+
</argument>
61+
</arguments>
62+
</action>
63+
</event>
64+
</events>
65+
<PhysicsObject>0</PhysicsObject>
66+
<PhysicsObjectSensor>0</PhysicsObjectSensor>
67+
<PhysicsObjectShape>0</PhysicsObjectShape>
68+
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
69+
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
70+
<PhysicsObjectGroup>0</PhysicsObjectGroup>
71+
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
72+
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
73+
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
74+
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
75+
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
76+
<PhysicsShapePoints/>
77+
</object>
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
2+
<object>
3+
<spriteName>sKeyEffect</spriteName>
4+
<solid>0</solid>
5+
<visible>-1</visible>
6+
<depth>0</depth>
7+
<persistent>0</persistent>
8+
<parentName>parItem</parentName>
9+
<maskName>&lt;undefined&gt;</maskName>
10+
<events>
11+
<event eventtype="0" enumb="0">
12+
<action>
13+
<libid>1</libid>
14+
<id>603</id>
15+
<kind>7</kind>
16+
<userelative>0</userelative>
17+
<isquestion>0</isquestion>
18+
<useapplyto>-1</useapplyto>
19+
<exetype>2</exetype>
20+
<functionname></functionname>
21+
<codestring></codestring>
22+
<whoName>self</whoName>
23+
<relative>0</relative>
24+
<isnot>0</isnot>
25+
<arguments>
26+
<argument>
27+
<kind>1</kind>
28+
<string>/// Initialize item
29+
30+
scrItemSetUp(0, 0, itemEnum.itemKey);
31+
scrItemSetProperties(false, "Těžký klíč", "Klíč vyrobený ze staré oceli, na hlavici je vyryt nápis " + chr(34) + "Stíny Krysovaru" + chr(34) + ".", -1, "", 0, rarity_quest);
32+
scrItemSetOptions("Content");
33+
scrItemSetUpFinalize();
34+
35+
</string>
36+
</argument>
37+
</arguments>
38+
</action>
39+
</event>
40+
<event eventtype="4" ename="oPlayer">
41+
<action>
42+
<libid>1</libid>
43+
<id>603</id>
44+
<kind>7</kind>
45+
<userelative>0</userelative>
46+
<isquestion>0</isquestion>
47+
<useapplyto>-1</useapplyto>
48+
<exetype>2</exetype>
49+
<functionname></functionname>
50+
<codestring></codestring>
51+
<whoName>self</whoName>
52+
<relative>0</relative>
53+
<isnot>0</isnot>
54+
<arguments>
55+
<argument>
56+
<kind>1</kind>
57+
<string>/// Loot
58+
59+
if (loot = 0)
60+
{
61+
if (inventoryPickUp())
62+
{
63+
audio_play_sound(sndRindPickup,0,0);
64+
scrLog("+ Těžký klíč",c_purple,sKeyEffect,0,0.5);
65+
}
66+
}
67+
</string>
68+
</argument>
69+
</arguments>
70+
</action>
71+
</event>
72+
<event eventtype="7" enumb="10">
73+
<action>
74+
<libid>1</libid>
75+
<id>603</id>
76+
<kind>7</kind>
77+
<userelative>0</userelative>
78+
<isquestion>0</isquestion>
79+
<useapplyto>-1</useapplyto>
80+
<exetype>2</exetype>
81+
<functionname></functionname>
82+
<codestring></codestring>
83+
<whoName>self</whoName>
84+
<relative>0</relative>
85+
<isnot>0</isnot>
86+
<arguments>
87+
<argument>
88+
<kind>1</kind>
89+
<string>/// After pick up
90+
91+
instance_destroy();
92+
93+
</string>
94+
</argument>
95+
</arguments>
96+
</action>
97+
</event>
98+
<event eventtype="8" enumb="0">
99+
<action>
100+
<libid>1</libid>
101+
<id>603</id>
102+
<kind>7</kind>
103+
<userelative>0</userelative>
104+
<isquestion>0</isquestion>
105+
<useapplyto>-1</useapplyto>
106+
<exetype>2</exetype>
107+
<functionname></functionname>
108+
<codestring></codestring>
109+
<whoName>self</whoName>
110+
<relative>0</relative>
111+
<isnot>0</isnot>
112+
<arguments>
113+
<argument>
114+
<kind>1</kind>
115+
<string>/// Draw item
116+
117+
itemDraw()
118+
</string>
119+
</argument>
120+
</arguments>
121+
</action>
122+
</event>
123+
</events>
124+
<PhysicsObject>0</PhysicsObject>
125+
<PhysicsObjectSensor>0</PhysicsObjectSensor>
126+
<PhysicsObjectShape>0</PhysicsObjectShape>
127+
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
128+
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
129+
<PhysicsObjectGroup>0</PhysicsObjectGroup>
130+
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
131+
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
132+
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
133+
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
134+
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
135+
<PhysicsShapePoints/>
136+
</object>

SimplexRPGEngine/Engine source/objects/oTransitionCollision.object.gmx

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
alpha = 0;
3131
alarm[0] = 1;
3232
text_parsed = 0;
33+
unlocked = true;
34+
itemNeeded = itemEnum.itemBasicItem;
35+
lockedText = "Zamčeno";
36+
unlockedNotification = "Odemčel jsem dveře.";
3337
event_inherited();
3438
</string>
3539
</argument>
@@ -56,6 +60,8 @@ event_inherited();
5660
<string>/// Parse collision text
5761

5862
text_parsed = dialogueParse(text);
63+
text_parsed_locked = dialogueParse(lockedText);
64+
5965
</string>
6066
</argument>
6167
</arguments>
@@ -90,10 +96,21 @@ if (instance_number(oPlayer) &gt; 0)
9096
}
9197

9298
if (keyboard_check_pressed(ord("E")) &amp;&amp; alpha &gt; 0.5)
93-
{
94-
oController.player_pos = player_pos;
95-
room_goto(level);
99+
{
100+
if (unlocked)
101+
{
102+
oController.player_pos = player_pos;
103+
room_goto(level);
104+
}
105+
else if (inventoryNumber(itemNeeded) &gt; 0)
106+
{
107+
unlocked = true;
108+
inventoryDelete(itemNeeded, 1);
109+
stateAddEntry(unlockedNotification);
110+
apiPlayerSplashEmoticon(0, 0.02);
111+
}
96112
}
113+
97114
}
98115
else {if (alpha &gt; 0) {alpha -= 0.05;}}
99116
}
@@ -147,14 +164,18 @@ with(other) {x = xprevious; y = yprevious;}
147164
<kind>1</kind>
148165
<string>/// Don't draw anything
149166

167+
tempText = text;
168+
w = text_parsed;
169+
if (!unlocked) {tempText = lockedText; w = text_parsed_locked;}
170+
150171
if (alpha &gt; 0.05)
151172
{
152173
draw_set_font(fntPixel);
153174
draw_set_alpha(alpha/2);
154-
draw_roundrect_colour_ext(xx-string_width(text_parsed)/2-10,yy-string_height(text_parsed)/2,xx+string_width(text_parsed)/2+10,yy+string_height(text_parsed)/2+4,20,20,c_black,c_black,0);
175+
draw_roundrect_colour_ext(xx-string_width(w)/2-10,yy-string_height(w)/2,xx+string_width(w)/2+10,yy+string_height(w)/2+4,20,20,c_black,c_black,0);
155176
draw_set_alpha(alpha);
156177
draw_set_color(c_white);
157-
draw_text_colored(xx-string_width(text_parsed)/2,yy-string_height(text_parsed)/2,text);
178+
draw_text_colored(xx-string_width(w)/2,yy-string_height(w)/2,tempText);
158179
draw_set_alpha(1);
159180
scrCenterText(0);
160181
}

SimplexRPGEngine/Engine source/rooms/mapTest.room.gmx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@
295295
<instance objName="oNonsolidCollision" x="1897" y="1546" name="inst_488F7013" locked="0" code="scrNonsolidCollisionIni(x,y-32,&quot;mapTest_kytka1&quot;,1,&quot;breakableGrass&quot;,3,layerEnum.layer2,false);&#xA;&#xA;text[0] = &quot;Pěkný &quot;+scrColorflag(colour_get_value(16763080))+&quot;růžový&quot;+scrEndColorflag()+&quot; keřík.&quot;&#xA;text[1] = &quot;Ty květy by se daly použít&quot;&#xA;text[2] = &quot;Použitelné už jsem otrhal.&quot;;" scaleX="1" scaleY="0.970000028610229" colour="4294967295" rotation="0"/>
296296
<instance objName="oNonsolidCollision" x="504" y="1240" name="inst_1DD750F4" locked="0" code="scrNonsolidCollisionIni(x, y-32, cStaticInstance, true, &quot;breakableGrass&quot;, 3, layerEnum.layer3);" scaleX="0.439999997615814" scaleY="0.4375" colour="4294967295" rotation="0"/>
297297
<instance objName="oNonsolidCollision" x="816" y="1264" name="inst_3B8B9126" locked="0" code="scrNonsolidCollisionIni(x, y-32, cStaticInstance, true, &quot;breakableGrass&quot;, 3, layerEnum.layer3);" scaleX="0.439999997615814" scaleY="0.4375" colour="4294967295" rotation="0"/>
298-
<instance objName="oNonsolidCollision" x="721" y="1265" name="inst_07FAF548" locked="0" code="scrNonsolidCollisionIni(x, y-32, cStaticInstance, true, &quot;breakableGrass&quot;, 3, layerEnum.layer3);" scaleX="0.709999978542328" scaleY="0.469999998807907" colour="4294967295" rotation="0"/>
299298
<instance objName="oNonsolidCollision" x="688" y="1328" name="inst_400B1674" locked="0" code="scrNonsolidCollisionIni(x, y-32, cStaticInstance, true, &quot;breakableGrass&quot;, 3, layerEnum.layer3);" scaleX="0.96875" scaleY="0.96875" colour="4294967295" rotation="0"/>
300299
<instance objName="oNonsolidCollision" x="463" y="1394" name="inst_850545AA" locked="0" code="scrNonsolidCollisionIni(x, y-32, cStaticInstance, true, &quot;breakableGrass&quot;, 3, layerEnum.layer3, true);" scaleX="0.333333343267441" scaleY="0.393939405679703" colour="4294967295" rotation="0"/>
301300
<instance objName="oNonsolidCollision" x="367" y="1362" name="inst_DC7DCDC4" locked="0" code="scrNonsolidCollisionIni(x, y-32, cStaticInstance, true, &quot;breakableGrass&quot;, 3, layerEnum.layer3, true);" scaleX="0.333333343267441" scaleY="0.393939405679703" colour="4294967295" rotation="0"/>
@@ -403,7 +402,7 @@
403402
<instance objName="oBasicCollision" x="212" y="112" name="inst_B6CC62B2" locked="0" code="" scaleX="1.125" scaleY="1.625" colour="4294967295" rotation="0"/>
404403
<instance objName="oBasicCollision" x="212" y="164" name="inst_5784553F" locked="0" code="" scaleX="0.75" scaleY="0.375" colour="4294967295" rotation="0"/>
405404
<instance objName="oBasicCollision" x="88" y="144" name="inst_F8325E65" locked="0" code="" scaleX="1.5" scaleY="0.125" colour="4294967295" rotation="0"/>
406-
<instance objName="oTransitionCollision" x="1712" y="912" name="inst_EFEED0CF" locked="0" code="level = mapKrysiSklipek;&#xA;text = &quot;Vstoupit do &quot; + scrColorflag(c_yellow) + &quot;Krysího sklípku&quot; + scrEndColorflag() + &quot;.&quot;;&#xA;xx = x;&#xA;yy = y-64;&#xA;text_lenght = 0;&#xA;player_pos = 0;" scaleX="0.5" scaleY="0.53125" colour="4294967295" rotation="0"/>
405+
<instance objName="oTransitionCollision" x="1712" y="912" name="inst_EFEED0CF" locked="0" code="level = mapKrysiSklipek;&#xA;text = &quot;Vstoupit do &quot; + scrColorflag(c_yellow) + &quot;Krysího sklípku&quot; + scrEndColorflag() + &quot;.&quot;;&#xA;xx = x;&#xA;yy = y-48;&#xA;text_lenght = 0;&#xA;player_pos = 0;&#xA;unlocked = false;&#xA;lockedText = &quot;Poklop pod schůdky je zamčený.&quot;;&#xA;itemNeeded = itemEnum.itemKey;&#xA;" scaleX="0.5" scaleY="0.53125" colour="4294967295" rotation="0"/>
407406
<instance objName="oAdvancedCollision" x="744" y="744" name="inst_C5032CD5" locked="0" code="/// Initialise&#xA;&#xA;scrAdvancedCollisionIni(x, y-32, &quot;pařezSeSekyrou&quot;, 1, &quot;breakableWood&quot;, 10, layerEnum.layer3);&#xA; scrAdvancedCollisionSetText(&quot;V pařezu je zaseklá sekera.&quot;);&#xA; scrAdvancedCollisionSetText(&quot;Sekerka se vždycky hodí&quot;);&#xA; scrAdvancedCollisionSetText(&quot;Pařez zeje prázdnotou.&quot;);&#xA;" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
408407
<instance objName="oBasicCollision" x="796" y="488" name="inst_F5FEBFDD" locked="0" code="" scaleX="5" scaleY="3" colour="4294967295" rotation="0"/>
409408
<instance objName="oBasicCollision" x="796" y="456" name="inst_499A0471" locked="0" code="" scaleX="4.75" scaleY="1" colour="4294967295" rotation="0"/>
@@ -470,6 +469,7 @@
470469
<instance objName="oStick" x="848" y="1392" name="inst_9A2D390A" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
471470
<instance objName="oLiana" x="896" y="1328" name="inst_090BD100" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
472471
<instance objName="oLiana" x="896" y="1376" name="inst_84BEE2FD" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
472+
<instance objName="oKey" x="928" y="1360" name="inst_F805C714" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
473473
</instances>
474474
<tiles>
475475
<tile bgName="bcgShd1" x="1600" y="1712" w="32" h="32" xo="32" yo="0" id="10006696" name="inst_AC26E277" depth="1000001" locked="0" colour="4294967295" scaleX="1" scaleY="1"/>

SimplexRPGEngine/Engine source/scripts/itemDbEnum.gml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ itemPouch,
7272
itemFurRabbit,
7373
itemBone,
7474
itemStick,
75-
itemLiana
75+
itemLiana,
76+
itemKey
7677
};

SimplexRPGEngine/Engine source/scripts/playerAPI.gml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,4 +1092,18 @@ i = vlastnost_zivot;
10921092

10931093
if (argument_count > 0) {i = argument[0];}
10941094

1095-
return (oPlayer.vlastnost[i]);
1095+
return (oPlayer.vlastnost[i]);
1096+
#define apiPlayerSplashEmoticon
1097+
/// apiPlayerSplashEmoticon(index, animationSpeed)
1098+
1099+
var i, I, a;
1100+
I = 0;
1101+
a = 0.1;
1102+
1103+
if (argument_count > 0) {I = argument[0];}
1104+
if (argument_count > 1) {a = argument[1];}
1105+
1106+
i = instance_create(oPlayer.x, oPlayer.y - 16, oEmoticon);
1107+
i.spd = a;
1108+
i.image_index = i;
1109+
160 Bytes
Loading
660 Bytes
Loading
637 Bytes
Loading

0 commit comments

Comments
 (0)