Skip to content

Commit d725dac

Browse files
author
lofcz
committed
Aktualizace craftingu
- Ve formuláři pro vylepšení předmětů jsou nyní menu pro perly a vylepšení. - Upraveda distribuční křivka vylepšení. - Skript scrItemSetReinforcementProperties rozšířen o parametry rUpgradeBaseSkill a rUpgradeIncSkill.
1 parent f72845c commit d725dac

15 files changed

Lines changed: 158 additions & 25 deletions

SimplexRPGEngine/Engine source/DragonRise3.project.gmx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
<sound>sound\sndWhetstone1</sound>
233233
<sound>sound\sndArcane5</sound>
234234
<sound>sound\sndArcane4</sound>
235+
<sound>sound\sndUpgrade1</sound>
235236
<sound>sound\sndFragment5</sound>
236237
</sounds>
237238
</sounds>
@@ -1489,7 +1490,7 @@
14891490
<room>rooms\mapSklep</room>
14901491
</rooms>
14911492
</rooms>
1492-
<constants number="252">
1493+
<constants number="254">
14931494
<constant name="baArmor">1</constant>
14941495
<constant name="baBase">0</constant>
14951496
<constant name="cStaticInstance">"staticInstance"</constant>
@@ -1556,7 +1557,9 @@
15561557
<constant name="quest_ready">1</constant>
15571558
<constant name="quest_noone">0</constant>
15581559
<constant name="upgradableProperties">58</constant>
1559-
<constant name="celkem_vlastnosti">109</constant>
1560+
<constant name="celkem_vlastnosti">111</constant>
1561+
<constant name="vlastnost_reinforcementUpgradeIncSkill">110</constant>
1562+
<constant name="vlastnost_reinforcementUpgradeBaseSkill">109</constant>
15601563
<constant name="vlastnost_reinforcementIs">108</constant>
15611564
<constant name="vlastnost_reinforcementCostIncM">107</constant>
15621565
<constant name="vlastnost_reinforcementCostInc">106</constant>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<spriteName>sBoard</spriteName>
44
<solid>0</solid>
55
<visible>-1</visible>
6-
<depth>-200</depth>
6+
<depth>-11</depth>
77
<persistent>0</persistent>
88
<parentName>parSolid</parentName>
99
<maskName>&lt;undefined&gt;</maskName>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ craftingHelper = -1;
6464
craftingTitle = "Výroba";
6565
craftingMenuAlpha = 1;
6666
craftingPreview = "";
67+
craftingSelectedOpt = 0;
6768
craftingMenuIndex[0] = "Předměty";
6869
craftingMenuIndex[1] = "Zdokonalení";
6970
craftingMenuIndex[2] = "Materiály";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ vlastnost[vlastnost_bodyCanvasIndex] = 8;
5656
vlastnost[vlastnost_bodyCanvasSprite] = sBodyCanvasWeapon1;
5757
vlastnost[vlastnost_bodyCanvasSlashSprite] = sBodyCanvasAttackWeapon1;
5858

59-
scrItemSetReinforcementProperties(irandom_range(0, 2), 2, 1, 0);
59+
scrItemSetReinforcementProperties(irandom_range(0, 2), 2, 5, 1, 2, 1);
6060
scrItemSetUpFinalize();
6161
</string>
6262
</argument>

SimplexRPGEngine/Engine source/scripts/scrCraftingDraw.gml

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,51 @@ else
272272

273273
if (upgradingItemSprite > 0)
274274
{
275+
c1 = c_white;
276+
c2 = c_white;
277+
c3 = c_black;
278+
c4 = c_black;
279+
280+
if (craftingSelectedOpt == 1) {c3 = c_white;}
281+
if (craftingSelectedOpt == 2) {c4 = c_white;}
282+
283+
284+
// Gems
285+
if (mouse_in(tempX + 22, tempX + 32 + string_width("Perly"), tempY + 4, tempY + 4 + string_height("Perly")))
286+
{
287+
c1 = c_lime;
288+
if (mouse_check_button_pressed(mb_left))
289+
{
290+
craftingSelectedOpt = 1;
291+
}
292+
}
293+
294+
// Upgrades
295+
if (mouse_in(tempX + 146, tempX + 156 + string_width("Vylepšení"), tempY + 4, tempY + 4 + string_height("Vylepšení")))
296+
{
297+
c2 = c_lime;
298+
if (mouse_check_button_pressed(mb_left))
299+
{
300+
craftingSelectedOpt = 2;
301+
}
302+
}
303+
304+
305+
clr(c3, 0.3);
306+
draw_roundrect(tempX + 22, tempY + 4, tempX + 32 + string_width("Perly"), tempY + 4 + string_height("Perly"), false);
307+
clr(c4, 0.3);
308+
draw_roundrect(tempX + 146, tempY + 4, tempX + 154 + string_width("Vylepšení"), tempY + 4 + string_height("Vylepšení"), false);
309+
310+
clr(c_black, 1);
311+
draw_roundrect(tempX + 22, tempY + 4, tempX + 32 + string_width("Perly"), tempY + 4 + string_height("Perly"), true);
312+
draw_roundrect(tempX + 146, tempY + 4, tempX + 154 + string_width("Vylepšení"), tempY + 4 + string_height("Vylepšení"), true);
313+
314+
clr(c1, 1);
315+
draw_text(tempX + 28, tempY + 4, "Perly");
316+
clr(c2, 1);
317+
draw_text(tempX + 150, tempY + 4, "Vylepšení");
318+
319+
275320
clr(-1, 0.8);
276321
draw_sprite(sRarityEffect, itemRarityEffect(oInventory.slot[upgradingItemSlotID, inv_item_effect]), tempX + 96 + 1, tempY + 1);
277322

@@ -324,14 +369,18 @@ else
324369
upgradingItemSprite = -1;
325370
upgradingItemID = -1;
326371
oInventory.slot[upgradingItemSlotID, inv_item_beingUsed] = false;
327-
upgradingItemSlotID = -1;
372+
upgradingItemSlotID = -1;
373+
craftingSelectedOpt = 0;
328374
}
329375
}
330376

331377

332378
// Slot for upgrade material
333-
if (upgradingItemID != -1)
379+
380+
if (upgradingItemID != -1 && craftingSelectedOpt == 1)
334381
{
382+
tempY += 16;
383+
335384
// Draw all upgrade slots
336385
for (i = 0; i < oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_maxUpgrade]; i++)
337386
{
@@ -409,9 +458,38 @@ else
409458
}
410459
}
411460
}
412-
}
461+
}
462+
tempY -= 16;
413463
}
414464

465+
cR = c_red;
466+
cZ = c_red;
467+
468+
if (upgradingItemID != -1 && craftingSelectedOpt == 2)
469+
{
470+
fnt(fntPixelSmall);
471+
clr(c_white, 1);
472+
tempY += 48;
473+
sU = oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementCostBase] + (oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementCostInc] * oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel]) + (oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel] * oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel] * oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementCostIncM]);
474+
sR = "Stupeň vylepšení: " + string(oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel]) + " / 10";
475+
sZ = oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementUpgradeBaseSkill] + (oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel] * oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementUpgradeIncSkill]);
476+
477+
if (oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel] == 11) {sR = "Stupeň vylepšení: arkánsky vylepšeno"}
478+
if (oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel] == 10) {sR = "Stupeň vylepšení: zcela vylepšeno"}
479+
if (apiPlayerGetPropertyValue(vlastnost_zrucnost) >= sZ) {cZ = c_lime;}
480+
if (inventoryNumber(itemEnum.itemAlchemyDust) >= sU) {cR = c_lime;}
481+
482+
draw_text(tempX + 4, tempY, sR);
483+
clr(cR, -1);
484+
draw_text(tempX + 4, tempY + 20, "Cena za další vylepšení: " + string(sU) + "x");
485+
draw_sprite(sTestItem, itemEnum.itemAlchemyDust - 1, tempX + 20 + string_width("Cena za další vylepšení: " + string(sU) + "x"), tempY + 30);
486+
clr(cZ, -1);
487+
draw_text(tempX + 4, tempY + 40, "Potřebná zručnost: " + string(sZ));
488+
clr(c_white, -1);
489+
tempY -= 48;
490+
fnt();
491+
}
492+
415493

416494
// Draw navigation
417495
// ******************************************
@@ -430,6 +508,8 @@ else
430508
}
431509
}
432510
}
511+
512+
if (craftingSelectedOpt == 2 && cR == c_lime && cZ == c_lime) {textColor = c_lime;}
433513

434514
// Check for on-hover event
435515
if (mouse_in(tempX + 16, tempX + 112, tempY + 170, tempY + 190))
@@ -438,6 +518,8 @@ else
438518

439519
// Confirm crafting
440520
if (mouse_check_button_pressed(mb_left) && textColor == c_lime)
521+
{
522+
if (craftingSelectedOpt == 1)
441523
{
442524
for (k = 0; k < 3; k++)
443525
{
@@ -474,6 +556,16 @@ else
474556
oInventory.slot[abs(upgradingItemSlotID), inv_item_beingUsed] = false;
475557
upgradingItemSlotID = -1;
476558
}
559+
560+
if (craftingSelectedOpt == 2)
561+
{
562+
inventoryDelete(itemEnum.itemAlchemyDust, sU);
563+
oInventory.slot_vlastnosti[upgradingItemSlotID, vlastnost_reinforcementLevel]++;
564+
scrItemUpdateReinforcementName(upgradingItemSlotID);
565+
scrItemUpdateReinforcementStats(upgradingItemSlotID);
566+
audio_play_sound(sndUpgrade1, 0, false);
567+
}
568+
}
477569
}
478570

479571
// Draw "upgrade button"
@@ -520,6 +612,7 @@ else
520612
craftingTitleHelper = "";
521613
craftingSelectedIndex = -1;
522614
craftingMenuAlpha = 1;
615+
craftingSelectedOpt = 0;
523616
}
524617
}
525618

SimplexRPGEngine/Engine source/scripts/scrItemSetReinforcementProperties.gml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
/// scrItemSetReinforcementProperties(rLevel, rLevelBaseCost, rLevelIncCost, rLevelIncMCost)
1+
/// scrItemSetReinforcementProperties(rLevel, rLevelBaseCost, rLevelIncCost, rLevelIncMCost, rUpgradeBaseSkill, rUpgradeIncSkill)
22

3-
var rl, rlbc, rlic, rlimc
3+
var rl, rlbc, rlic, rlimc, rubs, ruis
44
rl = 0;
55
rlbc = 1;
66
rlic = 1;
77
rlimc = 0;
8+
rubs = 0;
9+
ruis = 0;
810

911
if (argument_count > 0) {rl = argument[0];}
1012
if (argument_count > 1) {rlbc = argument[1];}
1113
if (argument_count > 2) {rlic = argument[2];}
1214
if (argument_count > 3) {rlimc = argument[3];}
15+
if (argument_count > 4) {rubs = argument[4];}
16+
if (argument_count > 5) {ruis = argument[5];}
1317

14-
vlastnost[vlastnost_reinforcementIs] = true;
15-
vlastnost[vlastnost_reinforcementLevel] = rl;
16-
vlastnost[vlastnost_reinforcementCostBase] = rlbc;
17-
vlastnost[vlastnost_reinforcementCostInc] = rlic;
18-
vlastnost[vlastnost_reinforcementCostIncM] = rlimc;
18+
vlastnost[vlastnost_reinforcementIs] = true;
19+
vlastnost[vlastnost_reinforcementLevel] = rl;
20+
vlastnost[vlastnost_reinforcementCostBase] = rlbc;
21+
vlastnost[vlastnost_reinforcementCostInc] = rlic;
22+
vlastnost[vlastnost_reinforcementCostIncM] = rlimc;
23+
vlastnost[vlastnost_reinforcementUpgradeBaseSkill] = rubs;
24+
vlastnost[vlastnost_reinforcementUpgradeIncSkill] = ruis;
1925

2026
scrItemUpdateReinforcementName();
2127
scrItemUpdateReinforcementStats();

SimplexRPGEngine/Engine source/scripts/scrItemUpdateReinforcementStats.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (s == -1)
1515
if (vlastnost[vlastnost_reinforcementLevel] >= 1)
1616
{
1717
xx = vlastnost[vlastnost_reinforcementLevel];
18-
m = ((((power(xx, 1.5)) + (log10(xx))) * 4) + 111.5);
18+
m = ((((power(xx, 1)) + (log10(xx))) * 1) + 111.5);
1919
for (var i = 0; i < celkem_vlastnosti; i++)
2020
{
2121
if (i != vlastnost_reinforcementCostBase && i != vlastnost_reinforcementCostInc && i != vlastnost_reinforcementCostIncM && i != vlastnost_reinforcementIs && i != vlastnost_reinforcementLevel && i != vlastnost_bodyCanvasIndex && i != vlastnost_bodyCanvasSprite && i != vlastnost_bodyCanvasSlashSprite && i != vlastnost_stamina_cost)
@@ -30,7 +30,7 @@ else
3030
if (oInventory.slot_vlastnosti[s, vlastnost_reinforcementLevel] >= 1)
3131
{
3232
xx = oInventory.slot_vlastnosti[s, vlastnost_reinforcementLevel];
33-
m = ((((power(xx, 1.5)) + (log10(xx))) * 4) + 111.5);
33+
m = ((((power(xx, 1)) + (log10(xx))) * 1) + 111.5);
3434
for (var i = 0; i < celkem_vlastnosti; i++)
3535
{
3636
if (i != vlastnost_reinforcementCostBase && i != vlastnost_reinforcementCostInc && i != vlastnost_reinforcementCostIncM && i != vlastnost_reinforcementIs && i != vlastnost_reinforcementLevel && i != vlastnost_bodyCanvasIndex && i != vlastnost_bodyCanvasSprite && i != vlastnost_bodyCanvasSlashSprite && i != vlastnost_stamina_cost)

SimplexRPGEngine/Engine source/scripts/scrMinimapDraw.gml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ for (i = 0; i < ds_list_size(pointList); i++)
8686
dy = oMinimap.y+((pointListY[| i]-oMinimap.y1)*oMinimap.sizey);
8787

8888
inCircle = false;
89-
if (point_in_circle(dx, dy, oMinimap.x + 100, oMinimap.y + 100, 96)) {if (pointListSprite[| i] != -1) {inCircle = true; draw_sprite_ext(sMinimapIcons, pointListSprite[| i], dx, dy, 0.5, 0.5, 0, c_white, min(1, oHUD.hudAlpha));}}
89+
m_alpha = (5 - (point_distance(oPlayer.x, oPlayer.y, pointListX[| i], pointListY[| i]) / 120));
90+
if (point_in_circle(dx, dy, oMinimap.x + 100, oMinimap.y + 100, 96)) {if (pointListSprite[| i] != -1) {inCircle = true; draw_sprite_ext(sMinimapIcons, pointListSprite[| i], dx, dy, 1, 1, 0, c_white, min(m_alpha, oHUD.hudAlpha));}}
9091
alg();
9192

9293
if (mouse_in(oMinimap.x+(( pointListX[| i]-oMinimap.x1)*oMinimap.sizex) - 8, oMinimap.x+(( pointListX[| i]-oMinimap.x1)*oMinimap.sizex) + 2, oMinimap.y+((pointListY[| i]-oMinimap.y1)*oMinimap.sizey) - 5, oMinimap.y+((pointListY[| i]-oMinimap.y1)*oMinimap.sizey) + 5))
340 KB
Binary file not shown.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
2+
<sound>
3+
<kind>0</kind>
4+
<extension>.wav</extension>
5+
<origname>sound\audio\sndUpgrade1.wav</origname>
6+
<effects>0</effects>
7+
<volume>
8+
<volume>1</volume>
9+
</volume>
10+
<pan>0</pan>
11+
<bitRates>
12+
<bitRate>192</bitRate>
13+
</bitRates>
14+
<sampleRates>
15+
<sampleRate>44100</sampleRate>
16+
</sampleRates>
17+
<types>
18+
<type>0</type>
19+
</types>
20+
<bitDepths>
21+
<bitDepth>16</bitDepth>
22+
</bitDepths>
23+
<preload>-1</preload>
24+
<data>sndUpgrade1.wav</data>
25+
<compressed>0</compressed>
26+
<streamed>0</streamed>
27+
<uncompressOnLoad>0</uncompressOnLoad>
28+
<audioGroup>0</audioGroup>
29+
</sound>

0 commit comments

Comments
 (0)