Skip to content

Commit

Permalink
Added secondary diagonal counting
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycrow101 committed Mar 20, 2022
1 parent d5a4e3e commit ee3c3f1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _**English** | [Русский](README.ru.md)_

AMX Mod X plugin for Counter-Strike.

The plugin allows you to place slot machines on the map and play them. The player places a bet and waits for a winning combination of symbols to appear. A victory is counted when a whole row or main diagonal is filled with the same symbols. There is an API for adding your own prizes and a tool for customizing the slot machine model.
The plugin allows you to place slot machines on the map and play them. The player places a bet and waits for a winning combination of symbols to appear. A victory is counted when a whole row or diagonal is filled with the same symbols. There is an API for adding your own prizes and a tool for customizing the slot machine model.

## Commands
* `slot_machine` — menu for placing slot machines on the map.
Expand Down
2 changes: 1 addition & 1 deletion README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _[English](README.md) | **Русский**_

AMX Mod X плагин для Counter-Strike.

Плагин позволяет размещать на карте слот машины (также известные как однорукие бандиты) и играть в них. Игрок делает ставку и ожидает выпадения выигрышной комбинации символов. Победа засчитывается при заполнении целого ряда или главной диагонали одинаковыми символами. Присутвует API для добавления собственных призов и вспомогательный инструмент для кастомизации модели игрового автомата.
Плагин позволяет размещать на карте слот машины (также известные как однорукие бандиты) и играть в них. Игрок делает ставку и ожидает выпадения выигрышной комбинации символов. Победа засчитывается при заполнении целого ряда или диагонали одинаковыми символами. Присутвует API для добавления собственных призов и вспомогательный инструмент для кастомизации модели игрового автомата.

## Команды
* `slot_machine` — меню размещения игровых автоматов на карте.
Expand Down
14 changes: 13 additions & 1 deletion addons/amxmodx/scripting/next21_slot_machine.sma
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <xs>

new const PLUGIN[] = "Slot Machine"
new const VERSION[] = "0.2"
new const VERSION[] = "0.3"
new const AUTHOR[] = "Psycrow"

new const MODEL_SLOTMACHINE[] = "models/next21_crimetown/slot_machine.mdl"
Expand Down Expand Up @@ -273,6 +273,18 @@ machine_calculate_prize(iEnt)
}
}

// Check matches along the secondary diagonal
for (i = 1; i < g_iReelsNum && s[i][g_iReelsNum-1-i] == s[i-1][g_iReelsNum-i]; i++) {}
if (i == g_iReelsNum)
{
iPrize = s[0][g_iReelsNum - 1]
if (iPrize > iTotal)
{
set_entvar(iEnt, var_body, g_iReelsNum + 2)
iTotal = iPrize
}
}

return iTotal
}

Expand Down
42 changes: 42 additions & 0 deletions utils/slot_machine_texgen/src/bodies/row_d_alt.smd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version 1
nodes
0 "root" -1
1 "reel1" 0
2 "arm" 0
3 "reel2" 0
4 "reel3" 0
end
skeleton
time 0
0 0.000000 0.139449 0.000000 1.570796 -0.000000 0.000000
1 -0.289186 1.147117 0.152040 0.000000 -0.000000 0.000000
2 0.577341 0.866400 0.155999 0.000000 -0.000000 0.000000
3 -0.088053 1.147117 0.152040 0.000000 -0.000000 0.000000
4 0.113081 1.147117 0.152040 0.000000 -0.000000 0.000000
end
triangles
row.bmp
0 -0.355349 -0.228218 1.087782 0.000000 -0.996730 -0.080810 0.001601 0.997307
0 -0.223024 -0.234960 1.170940 0.000000 -0.996730 -0.080810 0.001601 0.997307
0 -0.355349 -0.234960 1.170940 0.000000 -0.996730 -0.080810 0.001601 0.997307
row.bmp
0 -0.355349 -0.228218 1.087782 0.000000 -0.996730 -0.080810 0.001601 0.997307
0 -0.223024 -0.228218 1.087782 0.000000 -0.996730 -0.080810 0.001601 0.997307
0 -0.223024 -0.234960 1.170940 0.000000 -0.996730 -0.080810 0.001601 0.997307
row.bmp
0 0.046919 -0.207018 1.257633 0.000000 -0.761932 0.647657 0.001601 0.997307
0 0.179244 -0.152984 1.321201 0.000000 -0.761932 0.647657 0.001601 0.997307
0 0.046919 -0.152984 1.321201 0.000000 -0.761932 0.647657 0.001601 0.997307
row.bmp
0 0.046919 -0.207018 1.257633 0.000000 -0.761932 0.647657 0.001601 0.997307
0 0.179243 -0.207018 1.257633 0.000000 -0.761932 0.647657 0.001601 0.997307
0 0.179244 -0.152984 1.321201 0.000000 -0.761932 0.647657 0.001601 0.997307
row.bmp
0 -0.154215 -0.234511 1.174816 0.000000 -0.951784 0.306770 0.001601 0.997307
0 -0.021890 -0.208917 1.254224 0.000000 -0.951784 0.306770 0.001601 0.997307
0 -0.154215 -0.208917 1.254224 0.000000 -0.951784 0.306770 0.001601 0.997307
row.bmp
0 -0.154215 -0.234511 1.174816 0.000000 -0.951784 0.306770 0.001601 0.997307
0 -0.021890 -0.234511 1.174816 0.000000 -0.951784 0.306770 0.001601 0.997307
0 -0.021890 -0.208917 1.254224 0.000000 -0.951784 0.306770 0.001601 0.997307
end
1 change: 1 addition & 0 deletions utils/slot_machine_texgen/src/slot_machine.qc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ studio "bodies/row_1"
studio "bodies/row_2"
studio "bodies/row_3"
studio "bodies/row_d"
studio "bodies/row_d_alt"
}

$texrendermode "row.bmp" "additive"
Expand Down

0 comments on commit ee3c3f1

Please sign in to comment.