Skip to content

Commit

Permalink
Rozšířeno player API
Browse files Browse the repository at this point in the history
  • Loading branch information
lofcz committed Nov 9, 2016
1 parent 462325b commit c383f54
Show file tree
Hide file tree
Showing 42 changed files with 343 additions and 10 deletions.
6 changes: 5 additions & 1 deletion SimplexRPGEngine/Engine source/DragonRise3.project.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@
<sprite>sprites\sLetterEffect</sprite>
<sprite>sprites\sQuestEffect</sprite>
<sprite>sprites\sBoneEffect</sprite>
<sprite>sprites\sKeyEffect</sprite>
<sprite>sprites\sLockpickEffect</sprite>
</sprites>
<sprites name="Weapons">
Expand Down Expand Up @@ -608,6 +609,7 @@
<sprite>sprites\sprite242</sprite>
<sprite>sprites\sBarrel</sprite>
<sprite>sprites\sprite244</sprite>
<sprite>sprites\sEmoticons</sprite>
</sprites>
<backgrounds name="background">
<backgrounds name=" Single tile backgrounds">
Expand Down Expand Up @@ -1165,6 +1167,8 @@
<object>objects\oLog</object>
<object>objects\oAreaScript</object>
<object>objects\oCopyright</object>
<object>objects\oExplosion</object>
<object>objects\oEmoticon</object>
<object>objects\oRoomConroller</object>
</objects>
<objects name="Effects">
Expand Down Expand Up @@ -1329,6 +1333,7 @@
<object>objects\oRelicLeftPart</object>
<object>objects\oRelicRightPart</object>
<object>objects\oRelic</object>
<object>objects\oKey</object>
<object>objects\oPouch</object>
<object>objects\oAlchemyDust</object>
<object>objects\oLofsGift</object>
Expand Down Expand Up @@ -1373,7 +1378,6 @@
<object>objects\parSolid</object>
</objects>
</objects>
<object>objects\oExplosion</object>
</objects>
<timelines name="timelines">
<timelines name="Cutscenes">
Expand Down
77 changes: 77 additions & 0 deletions SimplexRPGEngine/Engine source/objects/oEmoticon.object.gmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sEmoticons</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-50</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/// Set up

image_speed = 0;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/// Animate

image_alpha = lerp(image_alpha, 0, spd);
y = lerp(y, ystart - 40, spd * 2);

if (image_alpha &lt; 0.02) {instance_destroy();}
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
<PhysicsObjectShape>0</PhysicsObjectShape>
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
<PhysicsObjectGroup>0</PhysicsObjectGroup>
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
<PhysicsShapePoints/>
</object>
136 changes: 136 additions & 0 deletions SimplexRPGEngine/Engine source/objects/oKey.object.gmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sKeyEffect</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>parItem</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/// Initialize item

scrItemSetUp(0, 0, itemEnum.itemKey);
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);
scrItemSetOptions("Content");
scrItemSetUpFinalize();

</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="4" ename="oPlayer">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/// Loot

if (loot = 0)
{
if (inventoryPickUp())
{
audio_play_sound(sndRindPickup,0,0);
scrLog("+ Těžký klíč",c_purple,sKeyEffect,0,0.5);
}
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="10">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/// After pick up

instance_destroy();

</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="8" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/// Draw item

itemDraw()
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
<PhysicsObjectShape>0</PhysicsObjectShape>
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
<PhysicsObjectGroup>0</PhysicsObjectGroup>
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
<PhysicsShapePoints/>
</object>
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
alpha = 0;
alarm[0] = 1;
text_parsed = 0;
unlocked = true;
itemNeeded = itemEnum.itemBasicItem;
lockedText = "Zamčeno";
unlockedNotification = "Odemčel jsem dveře.";
event_inherited();
</string>
</argument>
Expand All @@ -56,6 +60,8 @@ event_inherited();
<string>/// Parse collision text

text_parsed = dialogueParse(text);
text_parsed_locked = dialogueParse(lockedText);

</string>
</argument>
</arguments>
Expand Down Expand Up @@ -90,10 +96,21 @@ if (instance_number(oPlayer) &gt; 0)
}

if (keyboard_check_pressed(ord("E")) &amp;&amp; alpha &gt; 0.5)
{
oController.player_pos = player_pos;
room_goto(level);
{
if (unlocked)
{
oController.player_pos = player_pos;
room_goto(level);
}
else if (inventoryNumber(itemNeeded) &gt; 0)
{
unlocked = true;
inventoryDelete(itemNeeded, 1);
stateAddEntry(unlockedNotification);
apiPlayerSplashEmoticon(0, 0.02);
}
}

}
else {if (alpha &gt; 0) {alpha -= 0.05;}}
}
Expand Down Expand Up @@ -147,14 +164,18 @@ with(other) {x = xprevious; y = yprevious;}
<kind>1</kind>
<string>/// Don't draw anything

tempText = text;
w = text_parsed;
if (!unlocked) {tempText = lockedText; w = text_parsed_locked;}

if (alpha &gt; 0.05)
{
draw_set_font(fntPixel);
draw_set_alpha(alpha/2);
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);
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);
draw_set_alpha(alpha);
draw_set_color(c_white);
draw_text_colored(xx-string_width(text_parsed)/2,yy-string_height(text_parsed)/2,text);
draw_text_colored(xx-string_width(w)/2,yy-string_height(w)/2,tempText);
draw_set_alpha(1);
scrCenterText(0);
}
Expand Down
4 changes: 2 additions & 2 deletions SimplexRPGEngine/Engine source/rooms/mapTest.room.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
Expand Down Expand Up @@ -403,7 +402,7 @@
<instance objName="oBasicCollision" x="212" y="112" name="inst_B6CC62B2" locked="0" code="" scaleX="1.125" scaleY="1.625" colour="4294967295" rotation="0"/>
<instance objName="oBasicCollision" x="212" y="164" name="inst_5784553F" locked="0" code="" scaleX="0.75" scaleY="0.375" colour="4294967295" rotation="0"/>
<instance objName="oBasicCollision" x="88" y="144" name="inst_F8325E65" locked="0" code="" scaleX="1.5" scaleY="0.125" colour="4294967295" rotation="0"/>
<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"/>
<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"/>
<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"/>
<instance objName="oBasicCollision" x="796" y="488" name="inst_F5FEBFDD" locked="0" code="" scaleX="5" scaleY="3" colour="4294967295" rotation="0"/>
<instance objName="oBasicCollision" x="796" y="456" name="inst_499A0471" locked="0" code="" scaleX="4.75" scaleY="1" colour="4294967295" rotation="0"/>
Expand Down Expand Up @@ -470,6 +469,7 @@
<instance objName="oStick" x="848" y="1392" name="inst_9A2D390A" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
<instance objName="oLiana" x="896" y="1328" name="inst_090BD100" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
<instance objName="oLiana" x="896" y="1376" name="inst_84BEE2FD" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
<instance objName="oKey" x="928" y="1360" name="inst_F805C714" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
</instances>
<tiles>
<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"/>
Expand Down
3 changes: 2 additions & 1 deletion SimplexRPGEngine/Engine source/scripts/itemDbEnum.gml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ itemPouch,
itemFurRabbit,
itemBone,
itemStick,
itemLiana
itemLiana,
itemKey
};
16 changes: 15 additions & 1 deletion SimplexRPGEngine/Engine source/scripts/playerAPI.gml
Original file line number Diff line number Diff line change
Expand Up @@ -1092,4 +1092,18 @@ i = vlastnost_zivot;

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

return (oPlayer.vlastnost[i]);
return (oPlayer.vlastnost[i]);
#define apiPlayerSplashEmoticon
/// apiPlayerSplashEmoticon(index, animationSpeed)

var i, I, a;
I = 0;
a = 0.1;

if (argument_count > 0) {I = argument[0];}
if (argument_count > 1) {a = argument[1];}

i = instance_create(oPlayer.x, oPlayer.y - 16, oEmoticon);
i.spd = a;
i.image_index = i;

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c383f54

Please sign in to comment.