|
| [RGSS2]Emperor and Slave Minigame | |
| | Pengirim | Message |
---|
hart Senior
Posts : 805 Thanked : 38 Engine : Other Skill : Very Beginner Type : Developer
| Subyek: [RGSS2]Emperor and Slave Minigame 2010-11-04, 09:36 | |
| Emperor and Slave Versi: 1.5 Tipe: Minigame PengenalanIngat trid ini kan? https://rmid.forumotion.net/complete-games-f5/gm8card-minigame-t2455.htmnah, sekarang saya bikin versi RGSS2 nya. Fitur
- Bisa dipanggil via event.
- Hasil permainan(menang sebagai emperor, kalah sebagai emperor, menang sebagai slave, atau kalah sebagai slave) di simpan dalam sebuah variabel yang bisa ditentukan sendiri.
- Terdiri dari 4 tingkat kesulitan.
Cara menggunakan script
- Seperti biasa, copy paste di script editor di atas main
- Jangan lupa set file gambar di bagian script bila anda bukan mengambil script dari demo.
- Panggil minigame pada event dengan memilih bagian advanced, script, tuliskan
- Code:
-
$scene = Scene_EmperorAndSlave.new(1) untuk memakai emperor dan - Code:
-
$scene = Scene_EmperorAndSlave.new(2) sebagai slave.
ScreenshotsLihat SS di trid yg GM, hampir sama kok. Demohttp://www.mediafire.com/?2bpcoykhouc7eow Scriptsdianjurkan untuk mendonlod demonya, tapi kalau mau ya.. - Code:
-
#=============================================================================== # How to use: # - Copy paste to script editor above main # - Call via event script: # $scene = Scene_EmperorAndSlave.new(side, difficulty) # - Fill side with 1 to play as Emperor, or 2 to play as Slave. # - difficulty: fill with: # 1 = Easy # 2 = Normal # 3 = Hard # 4 = Impossible #=============================================================================== module Hart module EmperorAndSlave #=============================================================================== # Variable's ID to determine the result. # The value of this variable will determine the result as listed below # 1 = WIN using EMPEROR # 2 = LOSE using EMPEROR # 3 = WIN using SLAVE # 4 = LOSE using SLAVE #=============================================================================== RESULT_VARIABLE_ID = 1 #=============================================================================== # The card position # PLAYER_CARD_X and PLAYER_CARD_Y represents the x and y # coordinate of player's cards. # PLAYER_HORIZONTAL. If true, the cards will be displayed horizontally. # If false, they will be displayed vertically. # PLAYER_CARD_DISTANCE is the distance of each card. # PLAYER_PLAYCARD_X and PLAYER_PLAYCARD_Y are the x and y coordinate of the # played player's card. # Same for the enemy's part and pointer. # The comment value beside each constant are the ideal value if you want to use # vertical display. #=============================================================================== PLAYER_CARD_X = 0 PLAYER_CARD_Y = 234 #0 PLAYER_HORIZONTAL = true #false PLAYER_CARD_DISTANCE = -10 #-80 PLAYER_PLAYCARD_X = 400 PLAYER_PLAYCARD_Y = 208 ENEMY_CARD_X = 0 #434 ENEMY_CARD_Y = 0 ENEMY_HORIZONTAL = true #false ENEMY_CARD_DISTANCE = -10 #-80 ENEMY_PLAYCARD_X = 400 ENEMY_PLAYCARD_Y = 58
POINTER_X = 39 POINTER_Y = 384 #75 #=============================================================================== # The card's and pointer's sound file name #=============================================================================== SE_PATH = "Audio/SE/" CARD_SOUND_FILE = "Attack1.ogg" POINTER_SOUND_FILE = "Blow1.ogg" #=============================================================================== # Change the graphic name for each card and the pointer #=============================================================================== GRAPHICS_PATH = "Graphics/Pictures/" VILLAGER_FILE = "villager.png" EMPEROR_FILE = "emperor.png" SLAVE_FILE = "slave.png" CARDBACK_FILE = "cardback.png" POINTER_FILE = "pointer.png" #=============================================================================== # Don't change the code below this. #=============================================================================== VILLAGER = 0 EMPEROR = 1 SLAVE = 2 SIDE_ERR_MESSAGE = "Argumen pada pada event anda salah. Secara default, argumen pertama hanya boleh diisi dengan 1 atau 2." EASY = 1 NORMAL = 2 HARD = 3 IMPOSSIBLE = 4 DIFFICULTY_ERR_MESSAGE = "Argumen kedua dari event script hanya boleh berupa angka 1, 2, 3, atau 4" #=============================================================================== end end
class Scene_EmperorAndSlave < Scene_Base def initialize(player_side, difficulty = Hart::EmperorAndSlave::NORMAL) if player_side != Hart::EmperorAndSlave::EMPEROR && player_side != Hart::EmperorAndSlave::SLAVE print(Hart::EmperorAndSlave::SIDE_ERR_MESSAGE) $scene = nil end if difficulty < Hart::EmperorAndSlave::EASY || difficulty > Hart::EmperorAndSlave::IMPOSSIBLE print(Hart::EmperorAndSlave::DIFFICULTY_ERR_MESSAGE) $scene = nil end @difficulty = difficulty @player_side = player_side @number_of_cards = 5 @player_hand = [] @enemy_hand = [] @card_sprites = [] @pointer_sprite = Sprite.new @card_sprites[11] = Sprite.new @card_sprites[12] = Sprite.new @index = 0 end def start super create_menu_background Audio.se_play(Hart::EmperorAndSlave::SE_PATH + Hart::EmperorAndSlave:: CARD_SOUND_FILE) for i in 0 ... @number_of_cards @player_hand[i] = Hart::EmperorAndSlave::VILLAGER @enemy_hand[i] = Hart::EmperorAndSlave::VILLAGER @card_sprites[i] = Sprite.new @card_sprites[i + 5] = Sprite.new end case @player_side when Hart::EmperorAndSlave::EMPEROR @player_hand[rand(5)] = Hart::EmperorAndSlave::EMPEROR @enemy_hand[rand(5)] = Hart::EmperorAndSlave::SLAVE when Hart::EmperorAndSlave::SLAVE @player_hand[rand(5)] = Hart::EmperorAndSlave::SLAVE @enemy_hand[rand(5)] = Hart::EmperorAndSlave::EMPEROR end @pointer_sprite.bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::POINTER_FILE) @card_sprites[11].x = Hart::EmperorAndSlave::ENEMY_PLAYCARD_X @card_sprites[11].y = Hart::EmperorAndSlave::ENEMY_PLAYCARD_Y @card_sprites[11].z = 1000 @card_sprites[12].x = Hart::EmperorAndSlave::PLAYER_PLAYCARD_X @card_sprites[12].y = Hart::EmperorAndSlave::PLAYER_PLAYCARD_Y @card_sprites[12].z = 1000 end def terminate super dispose_menu_background for sprite in @card_sprites next if sprite == nil sprite.dispose end @pointer_sprite.dispose end def update super update_menu_background update_action update_draw end def update_draw for i in 0 ... @number_of_cards case @player_hand[i] when Hart::EmperorAndSlave::VILLAGER @card_sprites[i].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::VILLAGER_FILE) when Hart::EmperorAndSlave::EMPEROR @card_sprites[i].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::EMPEROR_FILE) when Hart::EmperorAndSlave::SLAVE @card_sprites[i].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::SLAVE_FILE) end if Hart::EmperorAndSlave::PLAYER_HORIZONTAL @card_sprites[i].x = Hart::EmperorAndSlave::PLAYER_CARD_X + i * (@card_sprites[i].bitmap.width + Hart::EmperorAndSlave::PLAYER_CARD_DISTANCE) @card_sprites[i].y = Hart::EmperorAndSlave::PLAYER_CARD_Y else @card_sprites[i].x = Hart::EmperorAndSlave::PLAYER_CARD_X @card_sprites[i].y = Hart::EmperorAndSlave::PLAYER_CARD_Y + i * (@card_sprites[i].bitmap.height + Hart::EmperorAndSlave::PLAYER_CARD_DISTANCE) end @card_sprites[i].visible = true @card_sprites[i + 5].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::CARDBACK_FILE) if Hart::EmperorAndSlave::ENEMY_HORIZONTAL @card_sprites[i + 5].x = Hart::EmperorAndSlave::ENEMY_CARD_X + i * (@card_sprites[i + 5].bitmap.width + Hart::EmperorAndSlave::ENEMY_CARD_DISTANCE) @card_sprites[i + 5].y = Hart::EmperorAndSlave::ENEMY_CARD_Y else @card_sprites[i + 5].x = Hart::EmperorAndSlave::ENEMY_CARD_X @card_sprites[i + 5].y = Hart::EmperorAndSlave::ENEMY_CARD_Y + i * (@card_sprites[i + 5].bitmap.height + Hart::EmperorAndSlave::ENEMY_CARD_DISTANCE) end @card_sprites[i + 5].visible = true end if Hart::EmperorAndSlave::PLAYER_HORIZONTAL @pointer_sprite.y = Hart::EmperorAndSlave::POINTER_Y @pointer_sprite.x = Hart::EmperorAndSlave::POINTER_X + @index * (@card_sprites[i].bitmap.width + Hart::EmperorAndSlave::PLAYER_CARD_DISTANCE) if @index != -1 else @pointer_sprite.y = Hart::EmperorAndSlave::POINTER_Y + @index * (@card_sprites[i].bitmap.height + Hart::EmperorAndSlave::PLAYER_CARD_DISTANCE) if @index != -1 @pointer_sprite.x = Hart::EmperorAndSlave::POINTER_X end end def update_action if Input.trigger?(Input::RIGHT) if Hart::EmperorAndSlave::PLAYER_HORIZONTAL @index = (@index + 1) % @number_of_cards Audio.se_play(Hart::EmperorAndSlave::SE_PATH + Hart::EmperorAndSlave:: POINTER_SOUND_FILE) end elsif Input.trigger?(Input::LEFT) if Hart::EmperorAndSlave::PLAYER_HORIZONTAL @index = (@index - 1 + @number_of_cards) % @number_of_cards Audio.se_play(Hart::EmperorAndSlave::SE_PATH + Hart::EmperorAndSlave:: POINTER_SOUND_FILE) end elsif Input.trigger?(Input::UP) if !Hart::EmperorAndSlave::PLAYER_HORIZONTAL @index = (@index - 1 + @number_of_cards) % @number_of_cards Audio.se_play(Hart::EmperorAndSlave::SE_PATH + Hart::EmperorAndSlave:: POINTER_SOUND_FILE) end elsif Input.trigger?(Input::DOWN) if !Hart::EmperorAndSlave::PLAYER_HORIZONTAL @index = (@index + 1) % @number_of_cards Audio.se_play(Hart::EmperorAndSlave::SE_PATH + Hart::EmperorAndSlave:: POINTER_SOUND_FILE) end elsif Input.trigger?(Input::C) process_card_battle end end def process_card_battle player_choose = @index player_card = @player_hand[player_choose] case @difficulty when Hart::EmperorAndSlave::EASY enemy_choose = rand(@number_of_cards) rndm = rand(101) if player_card == Hart::EmperorAndSlave::VILLAGER && @player_side == Hart::EmperorAndSlave::EMPEROR if rndm > 70 enemy_card = Hart::EmperorAndSlave::VILLAGER else enemy_card = Hart::EmperorAndSlave::SLAVE end elsif player_card == Hart::EmperorAndSlave::VILLAGER && @player_side == Hart::EmperorAndSlave::SLAVE if rndm > 60 enemy_card = Hart::EmperorAndSlave::EMPEROR else enemy_card = Hart::EmperorAndSlave::VILLAGER end elsif player_card == Hart::EmperorAndSlave::EMPEROR if rndm > 80 enemy_card = Hart::EmperorAndSlave::SLAVE else enemy_card = Hart::EmperorAndSlave::VILLAGER end elsif player_card == Hart::EmperorAndSlave::SLAVE if rndm > 60 enemy_card = Hart::EmperorAndSlave::VILLAGER else enemy_card = Hart::EmperorAndSlave::EMPEROR end end when Hart::EmperorAndSlave::NORMAL enemy_choose = rand(@number_of_cards) enemy_card = @enemy_hand[enemy_choose] when Hart::EmperorAndSlave::HARD enemy_choose = rand(@number_of_cards) rndm = rand(101) if player_card == Hart::EmperorAndSlave::VILLAGER && @player_side == Hart::EmperorAndSlave::EMPEROR if rndm > 30 enemy_card = Hart::EmperorAndSlave::VILLAGER else enemy_card = Hart::EmperorAndSlave::SLAVE end elsif player_card == Hart::EmperorAndSlave::VILLAGER && @player_side == Hart::EmperorAndSlave::SLAVE if rndm > 20 enemy_card = Hart::EmperorAndSlave::EMPEROR else enemy_card = Hart::EmperorAndSlave::VILLAGER end elsif player_card == Hart::EmperorAndSlave::EMPEROR if rndm > 40 enemy_card = Hart::EmperorAndSlave::SLAVE else enemy_card = Hart::EmperorAndSlave::VILLAGER end elsif player_card == Hart::EmperorAndSlave::SLAVE if rndm > 20 enemy_card = Hart::EmperorAndSlave::VILLAGER else enemy_card = Hart::EmperorAndSlave::EMPEROR end end when Hart::EmperorAndSlave::IMPOSSIBLE enemy_choose = rand(@number_of_cards) if player_card == Hart::EmperorAndSlave::VILLAGER && @player_side == Hart::EmperorAndSlave::EMPEROR enemy_card = Hart::EmperorAndSlave::VILLAGER elsif player_card == Hart::EmperorAndSlave::VILLAGER && @player_side == Hart::EmperorAndSlave::SLAVE enemy_card = Hart::EmperorAndSlave::EMPEROR elsif player_card == Hart::EmperorAndSlave::EMPEROR enemy_card = Hart::EmperorAndSlave::SLAVE elsif player_card == Hart::EmperorAndSlave::SLAVE enemy_card = Hart::EmperorAndSlave::VILLAGER end end @card_sprites[player_choose].visible = false @card_sprites[enemy_choose + 5].visible = false Audio.se_play(Hart::EmperorAndSlave::SE_PATH + Hart::EmperorAndSlave:: CARD_SOUND_FILE) case player_card when Hart::EmperorAndSlave::VILLAGER @card_sprites[12].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::VILLAGER_FILE) @card_sprites[12].visible = true when Hart::EmperorAndSlave::EMPEROR @card_sprites[12].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::EMPEROR_FILE) @card_sprites[12].visible = true when Hart::EmperorAndSlave::SLAVE @card_sprites[12].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::SLAVE_FILE) @card_sprites[12].visible = true end case enemy_card when Hart::EmperorAndSlave::VILLAGER @card_sprites[11].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::VILLAGER_FILE) @card_sprites[11].visible = true when Hart::EmperorAndSlave::EMPEROR @card_sprites[11].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::EMPEROR_FILE) @card_sprites[11].visible = true when Hart::EmperorAndSlave::SLAVE @card_sprites[11].bitmap = Cache.load_bitmap(Hart::EmperorAndSlave::GRAPHICS_PATH, Hart::EmperorAndSlave::SLAVE_FILE) @card_sprites[11].visible = true end Graphics.wait(120) if player_card == enemy_card elsif player_card == Hart::EmperorAndSlave::VILLAGER && enemy_card == Hart::EmperorAndSlave::EMPEROR $game_variables[Hart::EmperorAndSlave::RESULT_VARIABLE_ID] = 4 card_end elsif player_card == Hart::EmperorAndSlave::VILLAGER && enemy_card == Hart::EmperorAndSlave::SLAVE $game_variables[Hart::EmperorAndSlave::RESULT_VARIABLE_ID] = 1 card_end elsif player_card == Hart::EmperorAndSlave::EMPEROR && enemy_card == Hart::EmperorAndSlave::VILLAGER $game_variables[Hart::EmperorAndSlave::RESULT_VARIABLE_ID] = 1 card_end elsif player_card == Hart::EmperorAndSlave::EMPEROR && enemy_card == Hart::EmperorAndSlave::SLAVE $game_variables[Hart::EmperorAndSlave::RESULT_VARIABLE_ID] = 2 card_end elsif player_card == Hart::EmperorAndSlave::SLAVE && enemy_card == Hart::EmperorAndSlave::VILLAGER $game_variables[Hart::EmperorAndSlave::RESULT_VARIABLE_ID] = 4 card_end elsif player_card == Hart::EmperorAndSlave::SLAVE && enemy_card == Hart::EmperorAndSlave::EMPEROR $game_variables[Hart::EmperorAndSlave::RESULT_VARIABLE_ID] = 3 card_end end for i in player_choose ... @number_of_cards @player_hand[i] = @player_hand[i + 1] if @player_hand[i + 1] != nil end for i in enemy_choose ... @number_of_cards @enemy_hand[i] = @enemy_hand[i + 1] if @enemy_hand[i + 1] != nil end @number_of_cards -= 1 @index = @number_of_cards - 1 if @index == @number_of_cards clear_all end def clear_all for sprite in @card_sprites next if sprite == nil sprite.visible = false end end def card_end $scene = Scene_Map.new end end
Term of UseCredit saya, Hart, bila mau, kalau ga mau gpp. Thanks
- Film jepang yang judulnya.. Lupa. Karena permainan ini diambil dari situ.
- RMVX
- GM untuk gambar kartunya.
FAQQ: Kok komen di scriptnya pake bahasa inggris? A: ga tau, entah kenapa ini tangan tiba2 ngetik bahasa inggris Q: aku nemu bug! A: Lapor ke sini atau ke kantor polisi.
Terakhir diubah oleh hart tanggal 2010-11-08, 14:12, total 2 kali diubah | |
| | | LightNightKnight Topeng Buaya
Posts : 799 Thanked : 6 Engine : RMVX Skill : Intermediate Type : Developer
| Subyek: Re: [RGSS2]Emperor and Slave Minigame 2010-11-04, 14:03 | |
| wanzrot hebat bener buat game card buat RMVX mungkin bakal wa pake d TLW btw, gambar2 kartunya bisa diganti gak? dan kalo bisa apakah wa harus tetep credit GM ato kgk? | |
| | | hart Senior
Posts : 805 Thanked : 38 Engine : Other Skill : Very Beginner Type : Developer
| Subyek: Re: [RGSS2]Emperor and Slave Minigame 2010-11-04, 15:23 | |
| @om NR: ga hebat kok, ini cuma minigame super simpel(bikinnya aja cuma 3 jam-an) gambar kartu tentu saja bisa diganti, tapi harus berada di folder "Graphics/Pictures/". Kalau nama filenya beda dari yang di demo, bisa diatur di bagian scriptnya. Hmm.. kurasa kalau gambarnya diganti, ga perlu credit GM deh | |
| | | hart Senior
Posts : 805 Thanked : 38 Engine : Other Skill : Very Beginner Type : Developer
| Subyek: Re: [RGSS2]Emperor and Slave Minigame 2010-11-08, 14:22 | |
| UPDATE!! v1.5 changelog: - Bug bila permainan selesai pas di kartu terakhir error, telah diperbaiki. - Sekarang posisi kartu bisa diatur sesuka hati. - Begitu juga dengan pointernya(gambar penunjuknya). - Ukuran gambar kartu tidak lagi harus 110x150, anda bebas menggunakan gambar ukuran apapun(tapi jgn lupa diatur di configurasinya biar pas sesuai keinginan). - Sekarang file gambar kartu dan penunjuk tidak lagi harus ada di folder "Graphics/Pictures/". Anda bisa mengubahnya bila mau, bahkan anda bisa membuat 1 folder tersendiri khusus untuk minigame ini bila mau. - Kartu tidak lagi harus disusun secara horizontal, sekarang bisa vertikal dengan cara menset PLAYER_HORIZONTAL menjadi false(lihat di scriptnya). - Bila kartu disusun vertical, secara otomatis kontrol akan berganti menjadi atas dan bawah, bukan lagi kiri dan kanan - Lawan sekarang mempunyai tingkat kesulitan, yaitu easy, normal, hard, dan impossible. - Ketika memanggil via event script, anda bisa memasukkan argumen kedua untuk tingkat kesulitannya. 1 = easy, 2 = normal, 3 = hard, 4 = impossible contoh: - Code:
-
$scene = Scene_EmperorAndSlave.new(1, 2) yang berarti anda akan bermain sebagai Emperor, dengan tingkat kesulitan normal. - Beberapa algoritma yang terasa 'sia-sia' diubah. - Demo updated, dianjurkan mendonlod demonya | |
| | | Fahim Newbie
Posts : 34 Thanked : 1 Engine : RMVX Skill : Very Beginner Type : Artist
| Subyek: Re: [RGSS2]Emperor and Slave Minigame 2011-07-05, 21:22 | |
| gimana cara tambahin kartu nya ? | |
| | | hart Senior
Posts : 805 Thanked : 38 Engine : Other Skill : Very Beginner Type : Developer
| Subyek: Re: [RGSS2]Emperor and Slave Minigame 2011-07-06, 07:53 | |
| @^: ngga bisa bung, ini bukan TCG.. lagian kalau kartunya nambah jadi gimana mainnya? | |
| | | shikami Member 1000 Konsep
Posts : 3744 Thanked : 31 Engine : Multi-Engine User Skill : Beginner Type : Developer
Trophies
Awards:
| Subyek: Re: [RGSS2]Emperor and Slave Minigame 2011-07-06, 07:57 | |
| convert k rmxp juga dunk | |
| | | hart Senior
Posts : 805 Thanked : 38 Engine : Other Skill : Very Beginner Type : Developer
| Subyek: Re: [RGSS2]Emperor and Slave Minigame 2011-07-06, 07:58 | |
| @^: malas dan tak ada enginenya. | |
| | | Sponsored content
| Subyek: Re: [RGSS2]Emperor and Slave Minigame | |
| |
| | | | [RGSS2]Emperor and Slave Minigame | |
|
Similar topics | |
|
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
| Latest topics | » [Web Novel] Gloria Infidelis by LightNightKnight 2016-11-17, 21:27
» [Announcement] Forum baru untuk RMID by TheoAllen 2016-08-25, 16:39
» Where I'm Wrong ? by ReydVires 2016-07-24, 16:10
» flakeheartnet's Resources part III by flakeheartnet 2016-07-08, 14:30
» Keira's Art Warehouse by KeiraBlaze 2016-06-28, 19:27
» Theo Core Time System + Bingung by Lockin 2016-06-27, 16:24
» Error Script, Maybe ? by Lockin 2016-06-27, 16:20
» Nusaimoe @ RMID Lounge by Jihad Bagas 2016-06-21, 05:02
» Call Random Battle by Lockin 2016-06-15, 17:04
» Flakeheartnet Resources Part II [come back gift] by flakeheartnet 2016-06-07, 15:51
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|