Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
shadow7396

Rare Script Found and Need Team Members.

Recommended Posts

Hey I have a card game script(has more than one btw) that i was even lucky to find(Seeing as how no one really has made one), and i wanted to make a TCG using these scripts. I tested it on the demo that came with it and it was pretty good, but i would like to change it a bit if possible. Here are the scripts:

 

SETTINGS:

 

#==============================================================================
# â–  Setting Item
#==============================================================================
module TMCARD
SW_CAN_CANCEL = 1 # Switch number of deck selection Cancellation flag
SW_USE_MENU_EDIT = 2 # Switch number of deck editing command additional flag
SW_USE_MENU_TEST = 3 # Switch number of simulated duel command additional flag
VN_RESULT = 1 # Game variable number of game results are assigned
VN_COST_MAX = 2 # Game variable number for which you want to set the cost limit of deck

# Name of various parameters
TX_NAME = "Name"
TX_RARE = "Rare"
TX_COST = "Cost"
TX_HP = "HP"
TX_ATK = "ATK"
TX_TYPE = "Type"
TX_SKILL = "Skill"
TX_ELEMENT = "Element"

TYPE_NAME = ["A", "T", "D", "S"] # Type name
TYPE_ICON = [131, 133, 139, 136] # Type icon ID
ELEMENT_NAME = ["Fire", "Ice", "Lightning", "Water", "Earth", "Wind", "Nature", "Dark", "Magic"] # Attribute name
RARE_NAME = ["Common", "Uncommon", "Rare", "Legend"] # Rare degree of name attribute name

DECK_EDIT = "Deck Edit" # The name for the Deck Editing menu
DECK_TEST = "Deck Test" # Name in simulated duel menu of

# String to be given to the ending of the deck name (I set the same number as the maximum number of deck)
DECK_LETTER = ["A", "B", "C", "D", "E"]

# Whether or not to generate the graphics card in the script
# you can use directly as the card graphic images that have been prepared and to false
USE_AUTO_TEXT = true

DECK_MAX = 5 # The maximum number of registered available deck

TYPE_SPEED = [1, 4, 0, 2] # Speed value of each type
ATK_MAX = 8 # Upper limit of the attack force

AUTO_WAIT = 30 # Weight of automatic progression mode (frame)

WIDTH_STATUS_WINDOW = 240 # Width of the card status window

ANIME_SKILL = 40 # Animation ID when using the skill
ANIME_BONUS = 44 # Animation ID at the time of type bonus triggered
ANIME_DAMAGE = 1 # Animation ID of attack
end

 

OBJECTS:

 

#==============================================================================
# â–  Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# â— Object initialization
#--------------------------------------------------------------------------
alias tmcard_game_party_initialize initialize
def initialize
tmcard_game_party_initialize
@deck = []
(0...TMCARD::DECK_MAX).each {|i| @deck = [0, 0, 0] }
@active_deck = 0
end
#--------------------------------------------------------------------------
# â—‹ The deck which it appoints is returned
#--------------------------------------------------------------------------
def deck(index)
@deck[index]
end
#--------------------------------------------------------------------------
# â—‹ Total cost of the deck which it appoints is returned
#--------------------------------------------------------------------------
def cost(index)
n = 0
cards(index).each {|item| n += item.c_cost if item }
n
end
#--------------------------------------------------------------------------
# â—‹ The active deck is set
#--------------------------------------------------------------------------
def set_active_deck(index)
@active_deck = index
end
#--------------------------------------------------------------------------
# â—‹ The active deck (those which are utilized with battle) is returned
#--------------------------------------------------------------------------
def active_deck
@deck[@active_deck]
end
#--------------------------------------------------------------------------
# â—‹ The sequence acquisition of the card object
#--------------------------------------------------------------------------
def cards(index)
result = []
deck(index).each {|id| result.push($data_items[id]) }
result
end
#--------------------------------------------------------------------------
# â—‹ The change (I appoint it in an object) of the card
#--------------------------------------------------------------------------
def change_card(index, equip_type, item)
last_item = cards(index)[equip_type]
return if item && item_number(item) == 0
gain_item(last_item, 1)
lose_item(item, 1)
@deck[index][equip_type] = (item ? item.id : 0)
end
end

#==============================================================================
# â–  Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# â—‹ A deck check (if an effective deck is one, I give back the truth)
#--------------------------------------------------------------------------
def deck_valid?
(0...TMCARD::DECK_MAX).each do |i|
return true unless $game_party.deck(i).include?(0)
end
false
end
#--------------------------------------------------------------------------
# â—‹ The start of the card game
#--------------------------------------------------------------------------
def start_duel(enemy = [1, 2, 3], name = "Opponent")
return false unless deck_valid?
$game_temp.card_enemy_deck = enemy
$game_temp.card_enemy_name = name
SceneManager.call(Scene_DeckSelect)
true
end
#--------------------------------------------------------------------------
# â—‹ The start of the test game
#--------------------------------------------------------------------------
def start_test
return false unless deck_valid?
SceneManager.call(Scene_DeckTest)
true
end
#--------------------------------------------------------------------------
# â—‹ take off all cards of the deck which I appointed
#--------------------------------------------------------------------------
def remove_card_all(deck_index)
(0...3).each {|i| $game_party.change_card(deck_index, i, nil) }
end
#--------------------------------------------------------------------------
# â—‹ I build a deck with the card which I appointed
#--------------------------------------------------------------------------
def make_deck(deck_index, cards)
(0...3).each do |i|
item = $data_items[cards]
$game_party.change_card(deck_index, i, item)
end
end
end

#==============================================================================
# â–¡ Game_Deck
#==============================================================================
class Game_Deck
#--------------------------------------------------------------------------
# â—‹ public instance variable
#--------------------------------------------------------------------------
attr_reader :cost # total cost of deck
attr_reader :lose # defeated card number
attr_accessor :deck # card deck
attr_accessor :name # name of the player
attr_accessor :skill # skills
attr_accessor :skill_cnt # skill use number of times
attr_accessor :used_skill # skill use flag in turn
attr_accessor :hp # HP
attr_accessor :jp # JP
attr_accessor :hp_draw # drawing HP
attr_accessor :jp_draw # drawing Jï¼°
attr_accessor :refresh_move # card location update flag
#--------------------------------------------------------------------------
# â—‹ object initialization
#--------------------------------------------------------------------------
def initialize(card, name)
@deck = []
(0...3).each {|i| @deck.push(Game_Card.new(card)) }
@name = name
@lose = 0
@cost = 0
@skill = []
(0...3).each do |i|
@skill = @deck.skill(0)
@cost += @deck.cost
end
@skill[3] = @deck[0].skill(1)
@skill_cnt = [0, 0, 0, 0]
@used_skill = []
@hp = @deck[0].hp
@jp = @deck[0].atk
@hp_draw = 0
@jp_draw = 0
@refresh_move = false
end
#--------------------------------------------------------------------------
# â—‹ turn at the start of the initialization process
#--------------------------------------------------------------------------
def init_turn_start
@used_skill = []
card.increase_turn # turn number of added
end
#--------------------------------------------------------------------------
# â—‹ battle impossible process at the time of
#--------------------------------------------------------------------------
def knockout
card.down # card reset
reset_skill_cnt # skill use count reset
@lose += 1 # defeat card number additionq
set_next if @lose < 3 # and set the following card
end
#--------------------------------------------------------------------------
# â—‹ and set the next card
#--------------------------------------------------------------------------
def set_next
@hp = card.hp
@jp = [card.atk, $game_duel.jp_max].min
@hp_draw = @hp
@jp_draw = @jp
@skill[3] = card.skill(1)
@refresh_move = true
end
#--------------------------------------------------------------------------
# â—‹ skill usage count reset
#--------------------------------------------------------------------------
def reset_skill_cnt
@skill_cnt = [0, 0, 0, 0]
end
#--------------------------------------------------------------------------
# â—‹ I return the active card
#--------------------------------------------------------------------------
def card
@deck[@lose]
end
#--------------------------------------------------------------------------
# â—‹ I return the card cost value of
#--------------------------------------------------------------------------
def cost(index = -1)
@deck[index == -1 ? @lose : index].cost
end
#--------------------------------------------------------------------------
# â—‹ I return the card type value of
#--------------------------------------------------------------------------
def type(index = -1)
@deck[index == -1 ? @lose : index].type
end
#--------------------------------------------------------------------------
# â—‹ I return the card of attribute values
#--------------------------------------------------------------------------
def element(index = -1)
@deck[index == -1 ? @lose : index].element
end
#--------------------------------------------------------------------------
# â—‹ I return the rarity value of card
#--------------------------------------------------------------------------
def rare(index = -1)
@deck[index == -1 ? @lose : index].rare
end
#--------------------------------------------------------------------------
# â—‹ I return the number of turns card
#--------------------------------------------------------------------------
def turn(index = -1)
@deck[index == -1 ? @lose : index].turn
end
end

#==============================================================================
# â–¡ Game_Card
#==============================================================================
class Game_Card
#--------------------------------------------------------------------------
# â—‹ public instance variable
#--------------------------------------------------------------------------
attr_reader :opacity # transparency
attr_reader :file_name # image file name of card
attr_reader :turn # card-specific turn number of elapsed
attr_reader :state # state of card
#--------------------------------------------------------------------------
# â—‹ object initialization
#--------------------------------------------------------------------------
def initialize(id)
@card = $data_items[id]
@file_name = sprintf("card_%d", id)
@opacity = 255
@turn = 0
@state = 0
end
#--------------------------------------------------------------------------
# â—‹ increase of turn
#--------------------------------------------------------------------------
def increase_turn
@turn += 1
end
#--------------------------------------------------------------------------
# â—‹ state addition of
#--------------------------------------------------------------------------
def add_state(value)
@state |= value
end
#--------------------------------------------------------------------------
# â—‹ I make the transparency to 50%
#--------------------------------------------------------------------------
def down
@opacity = 128
end
#--------------------------------------------------------------------------
# â—‹ various parameter acquisition
#--------------------------------------------------------------------------
def id; @card.id; end
def name; @card.name; end
def cost; @card.c_cost; end
def hp; @card.c_hp; end
def atk; @card.c_atk; end
def type; @card.c_type; end
def element; @card.c_element; end
def rare; @card.c_rare; end
def skill(index); @card.c_skill(index); end
end

 

SPRITE_INFO:

 

#==============================================================================
# â–¡ Sprite_Info
#==============================================================================
class Sprite_Info # --------------------------------------------------------------------------
# â— public instance variable
# --------------------------------------------------------------------------
attr_accessor: hp # drawing for HP
attr_accessor: jp # drawing for JP
# --------------------------------------------------------------------------
# â— object initialization
# --------------------------------------------------------------------------
def initialize
super (nil)
@player = $ game_duel.player
self.bitmap = Bitmap.new (Graphics.width, Graphics.height)
self.z = 300
hp = [0, 0]
jp = [0, 0]
# Drawing of player name
self.bitmap.fill_rect (0, 8, width, 24, Color.new (0, 0, 0, 128))
self.bitmap.draw_text (16, 8, width - 32, 24,player [0] .name)
self.bitmap.draw_text (16, 8, width - 32, 24,player [1] .name, 2)
refresh
end
#--------------------------------------------------------------------------
# â— release
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
# ------------------------------------------------- -------------------------
# â— frame update
# ------------------------------------------------- -------------------------
def update
flag = false
(0...2) .each do | i |
if @hp != @player .hp_draw
@hp += @hp < @player .hp_draw ? 1 : -1
flag = true
end
if @jp != @player.jp_draw
@jp += @jp < @player.jp_draw ? 1 : -1
flag = true
end
end
refresh if flag
end
#--------------------------------------------------------------------------
# â—‹ to set the message
#--------------------------------------------------------------------------
def set_message(text)
self.bitmap.clear_rect(0, 376, width, 24)
self.bitmap.font.name = Font.default_name
self.bitmap.font.shadow = true
self.bitmap.font.size = 20
self.bitmap.font.color = Color.new(255, 255, 255)
self.bitmap.fill_rect(0, 376, width, 24, Color.new(0, 0, 0, 128))
self.bitmap.draw_text(0, 376, width, 24, text, 1)
end
#--------------------------------------------------------------------------
# â—‹ number is I return whether in change
#--------------------------------------------------------------------------
def drawing?
(0...2).each do |i|
return true if @hp != @player.hp_draw
return true if @jp != @player.jp_draw
end
false
end
#--------------------------------------------------------------------------
# â—‹ redraw
#--------------------------------------------------------------------------
def refresh
self.bitmap.clear_rect(0, 240, width, 128)
self.bitmap.font.name = ["Arial Black", "VL Gothic"]
self.bitmap.font.shadow = false
self.bitmap.font.size = 96
self.bitmap.font.color = Color.new(0, 0, 0)
self.bitmap.font.out_color.set(255, 255, 255)
self.bitmap.draw_text(16, 256, 128, 96, @hp[0].to_s, 1)
self.bitmap.draw_text(400, 256, 128, 96, @hp[1].to_s, 1)
self.bitmap.font.size = 64
self.bitmap.font.color = Color.new(224, 0, 0)
self.bitmap.font.out_color.set(0, 0, 0)
self.bitmap.draw_text(80, 256, 128, 64, @jp[0].to_s, 1)
self.bitmap.draw_text(336, 256, 128, 64, @jp[1].to_s, 1)
end
end

#==============================================================================
# â–¡ Sprite_Cursor
#==============================================================================
class Sprite_Cursor < Sprite
#--------------------------------------------------------------------------
# â— object initialization
#--------------------------------------------------------------------------
def initialize
super(nil)
@turn = $game_duel.turn
self.bitmap = Cache.system("effect")
self.x = @turn == 0 ? 80 : 464
self.y = 304
self.z = 200
self.ox = 64
self.oy = 64
self.blend_type = 1
self.opacity = 160
@move_cnt = 8
@move_dist = 0
@last_x = 0
end
#--------------------------------------------------------------------------
# â— release
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
#--------------------------------------------------------------------------
# â— frame update
#--------------------------------------------------------------------------
def update
move if @turn != $game_duel.turn
# Rotation
self.angle -= 1
self.angle += 360 if self.angle < 0
# Change size
self.zoom_x = Math.sin( self.angle * Math::PI / 180 ) * 0.25 + 1.0 ;
self.zoom_y = self.zoom_x
# Move
if @move_cnt < 8
@move_cnt += 1
d = Math.sin(@move_cnt * Math::PI / 16)
self.x = @last_x + d * @move_dist
end
end
#--------------------------------------------------------------------------
# â—‹ set of destination
#--------------------------------------------------------------------------
def move
@turn = $game_duel.turn
@last_x = self.x
@move_dist = (@turn == 0 ? 80 : 464) - self.x
@move_cnt = 0
end
end

#==============================================================================
# â–¡ Sprite_Card
#==============================================================================
class Sprite_Card < Sprite_Base
#--------------------------------------------------------------------------
# â— object initialization
#--------------------------------------------------------------------------
def initialize(card)
super(nil)
@card = card
make_card_bitmap
self.z = 250
@shake_x = 0
@shake_angle = 0.0
@move_cnt = 64
@move_dist = [0, 0, 1.0]
@last_pos = [0, 0, 1.0]
end
#--------------------------------------------------------------------------
# â—‹ Creating a card graphics
#--------------------------------------------------------------------------
def make_card_bitmap
return unless @card
self.bitmap.dispose if self.bitmap
if TMCARD::USE_AUTO_TEXT
self.bitmap = Bitmap.new(128, 192)
bitmap_back = Cache.system("c_back_#{@card.rare}")
self.bitmap.blt(0, 0, bitmap_back, bitmap_back.rect)
bitmap_picture = Bitmap.new("Graphics/Pictures/#{@card.file_name}")
self.bitmap.blt(0, 0, bitmap_picture, bitmap_picture.rect)
bitmap_picture.dispose
bitmap_frame = Cache.system("c_frame_#{@card.element}")
self.bitmap.blt(0, 0, bitmap_frame, bitmap_frame.rect)
bitmap_rare = Cache.system("c_rare_#{@card.rare}")
self.bitmap.blt(0, 0, bitmap_rare, bitmap_rare.rect)
self.bitmap.font.name = "VL Gothic"
self.bitmap.font.size = 16
self.bitmap.font.color.set(0, 0, 0)
self.bitmap.font.out_color.set(255, 255, 255)
self.bitmap.draw_text(23, 5, 99, 16, @card.name)
self.bitmap.draw_text(6, 151, 116, 16, "★" + @card.skill(0).name)
self.bitmap.draw_text(6, 169, 116, 16, "★" + @card.skill(1).name)
self.bitmap.font.name = ["Arial Black", "VL Gothic"]
self.bitmap.font.size = 18
text = sprintf("%d / %d", @card.hp, @card.atk)
self.bitmap.draw_text(81, 116, 41, 16, text, 1)
self.bitmap.draw_text(6, 116, 25, 16, @card.cost, 1)
bitmap_icon = Cache.system("IconSet")
index = TMCARD::TYPE_ICON[@card.type]
rect = Rect.new(index % 16 * 24, index / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, bitmap_icon, rect)
else
self.bitmap = Cache.picture(@card.file_name)
end
end
#--------------------------------------------------------------------------
# â— release
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
#--------------------------------------------------------------------------
# â—‹ Change of position and size
#--------------------------------------------------------------------------
def set(x, y, xsize, ysize)
self.x = x
self.y = y
self.zoom_x = xsize
self.zoom_y = ysize
@base_x = x
end
#--------------------------------------------------------------------------
# â—‹ set of destination
#--------------------------------------------------------------------------
def move(x, y, size)
@last_pos = [self.x, self.y, self.zoom_x]
@move_dist = [x - self.x, y - self.y, size - self.zoom_x]
@move_cnt = 0
end
#--------------------------------------------------------------------------
# â—‹ I shake
#--------------------------------------------------------------------------
def shake
@shake_x = 32
@angle_x = 0.0
end
#--------------------------------------------------------------------------
# â—‹ Return to see if you are shaking
#--------------------------------------------------------------------------
def shake?
return @shake_x > 0
end
#--------------------------------------------------------------------------
# â— frame update
#--------------------------------------------------------------------------
def update
super
if @shake_x > 0
@angle_x += 0.7
@shake_x -= 1
self.x = @base_x + (Math.cos(@angle_x) * @shake_x).to_i
end
if @move_cnt < 64
@move_cnt += 4
d = Math.sin(@move_cnt * Math::PI / 128)
self.x = @last_pos[0] + d * @move_dist[0]
self.y = @last_pos[1] + d * @move_dist[1]
self.zoom_x = @last_pos[2] + d * @move_dist[2]
self.zoom_y = self.zoom_x
@base_x = self.x
end
self.opacity = @card.opacity
end
end

#==============================================================================
# â–¡ Spriteset_Card
#==============================================================================
class Spriteset_Card
#--------------------------------------------------------------------------
# â—‹ object initialization
#--------------------------------------------------------------------------
def initialize
@sprite_info = Sprite_Info.new
@sprite_cursor = Sprite_Cursor.new
@sprite_card = []
(0...2).each do |i|
@sprite_card = [
Sprite_Card.new($game_duel.player.deck[0]),
Sprite_Card.new($game_duel.player.deck[1]),
Sprite_Card.new($game_duel.player.deck[2])
]
end
@sprite_card[0][0].set(16, 48, 1.0, 1.0)
@sprite_card[0][1].set(144, 40, 0.5, 0.5)
@sprite_card[0][2].set(208, 40, 0.5, 0.5)
@sprite_card[1][0].set(400, 48, 1.0, 1.0)
@sprite_card[1][1].set(336, 152, 0.5, 0.5)
@sprite_card[1][2].set(272, 152, 0.5, 0.5)
end
#--------------------------------------------------------------------------
# â—‹ release
#--------------------------------------------------------------------------
def dispose
@sprite_info.dispose
@sprite_cursor.dispose
(0...2).each do |i|
(0...3).each {|j| @sprite_card[j].dispose }
end
end
#--------------------------------------------------------------------------
# â—‹ frame update
#--------------------------------------------------------------------------
def update
# Damage effects
(0...2).each do |i|
index = $game_duel.player.lose
sprite = @sprite_card[index]
next if index == 3
if @sprite_info.hp > $game_duel.player.hp_draw && !sprite.shake?
sprite.shake # card
sprite.start_animation($data_animations[TMCARD::ANIME_DAMAGE])
if $game_duel.player.hp_draw == 0
i == 0 ? Sound.play_actor_collapse : Sound.play_enemy_collapse
end
end
end
@sprite_info.update
@sprite_cursor.update
(0...3).each do |i|
@sprite_card[0].update
@sprite_card[1].update
end
end
#--------------------------------------------------------------------------
# â—‹ I to move the card
#--------------------------------------------------------------------------
def move_card(user)
if user == 0
if $game_duel.player[0].lose == 1
@sprite_card[0][0].move(208, 40, 0.5)
@sprite_card[0][1].move(16, 48, 1.0)
@sprite_card[0][2].move(144, 40, 0.5)
else
@sprite_card[0][0].move(144, 40, 0.5)
@sprite_card[0][1].move(208, 40, 0.5)
@sprite_card[0][2].move(16, 48, 1.0)
end
$game_duel.player[0].refresh_move = false
else
if $game_duel.player[1].lose == 1
@sprite_card[1][0].move(272, 152, 0.5)
@sprite_card[1][1].move(400, 48, 1.0)
@sprite_card[1][2].move(336, 152, 0.5)
else
@sprite_card[1][0].move(336, 152, 0.5)
@sprite_card[1][1].move(272, 152, 0.5)
@sprite_card[1][2].move(400, 48, 1.0)
end
$game_duel.player[1].refresh_move = false
end
end
#--------------------------------------------------------------------------
# â—‹ to set the message
#--------------------------------------------------------------------------
def set_message(text)
@sprite_info.set_message(text)
end
#--------------------------------------------------------------------------
# â—‹ I give back whether numerical value is changing
#--------------------------------------------------------------------------
def drawing?
@sprite_info.drawing?
end
#--------------------------------------------------------------------------
# â—‹ Start animation of card
#--------------------------------------------------------------------------
def start_animation(user, index, animation_id)
animation = $data_animations[animation_id]
@sprite_card[user][index].start_animation(animation)
end
end

 

GAME_DUEL:

 

#==============================================================================
# â–¡ Game_Duel
#==============================================================================
class Game_Duel
#--------------------------------------------------------------------------
# â—‹ A public instance variable
#--------------------------------------------------------------------------
attr_reader :player # A player
attr_reader :turn # Turn
attr_reader :message # Message
attr_reader :jp_max # The upper limit of the offensive ability
attr_accessor :auto_flag # An automatic flag
#--------------------------------------------------------------------------
# â—‹ Setup
#--------------------------------------------------------------------------
def setup(enemy, name)
@player = [
Game_Deck.new($game_party.active_deck, $game_party.name),
Game_Deck.new(enemy, name)
]
@phase = 0
@damage = 0
@jp_max = TMCARD::ATK_MAX # The JP upper limit value
@type_bonus = true # A type bonus effective flag
@turn = get_first # Batting first decision
@message = []
@map_bgm = RPG::BGM.last
@map_bgs = RPG::BGS.last
RPG::BGM.stop
RPG::BGS.stop
Sound.play_battle_start
$game_system.battle_bgm.play
@auto_flag = false
end
#--------------------------------------------------------------------------
# â—‹ Batting first decision
#--------------------------------------------------------------------------
def get_first
if @player[0].cost != @player[1].cost # Cost comparison in total
return (@player[0].cost < @player[1].cost ? 0 : 1)
end
(0...3).each do |i|
# Type value comparison
a = TMCARD::TYPE_SPEED[@player[0].type(i)]
b = TMCARD::TYPE_SPEED[@player[1].type(i)]
return (a > b ? 0 : 1) if a != b
# HP comparison
a = @player[0].deck.hp
b = @player[1].deck.hp
return (a < b ? 0 : 1) if a != b
# JP comparison
a = @player[0].deck.atk
b = @player[1].deck.atk
return (a < b ? 0 : 1) if a != b
end
# Card ID comparison
(0...3).each do |i|
a = @player[0].deck.id
b = @player[1].deck.id
return (a < b ? 0 : 1) if a != b
end
return 1 # In the case of the totally same deck, an enemy attacks first
end
#--------------------------------------------------------------------------
# â—‹ I return an active player
#--------------------------------------------------------------------------
def active_player
@player[@turn]
end
#--------------------------------------------------------------------------
# â—‹ Frame update
#--------------------------------------------------------------------------
def update
attacker = @player[@turn]
target = @player[@turn ^ 1]
case @phase
when 0 # 準備フェイズ
attacker.init_turn_start # ターン開始時ã®åˆæœŸåŒ–処ç†
add_message(sprintf("%s's turn", attacker.name))
update_rebound(attacker) # スキルã®å動処ç†
check_skill # スキル発動ãƒã‚§ãƒƒã‚¯
@phase += 1 # 次ã®ãƒ•ã‚§ã‚¤ã‚ºã¸
when 1 # 計算フェイズ
add_message(sprintf("%s attacks!", attacker.card.name))
@damage = attacker.jp
apply_type_bonus(attacker, target) # タイプボーナスã®é©ç”¨
check_skill # スキル発動ãƒã‚§ãƒƒã‚¯
@phase += 1 # 次ã®ãƒ•ã‚§ã‚¤ã‚ºã¸
when 2 # 攻撃フェイズ
target.hp = [target.hp - @damage, 0].max
add_message(sprintf("%s took %d damage!", target.card.name, @damage))
# HPã«å¤‰åŒ–ãŒã‚ã‚‹é™ã‚Šã‚¹ã‚­ãƒ«ç™ºå‹•ãƒã‚§ãƒƒã‚¯ã‚’ç¹°ã‚Šè¿”ã™
while(1)
a = attacker.hp
b = target.hp
check_skill
break if a == attacker.hp && b == target.hp
end
@phase += 1 # 次ã®ãƒ•ã‚§ã‚¤ã‚ºã¸
when 3 # 判定フェイズ
@player.each {|deck| deck.knockout if deck.hp == 0 } # 戦闘ä¸èƒ½åˆ¤å®š
judge_win_loss # å‹æ•—判定
@phase += 1 # 次ã®ãƒ•ã‚§ã‚¤ã‚ºã¸
else # 終了フェイズ
@turn = @turn ^ 1
@phase = 0
end
end
#--------------------------------------------------------------------------
# â—‹ スキルã®å動処ç†
#--------------------------------------------------------------------------
def update_rebound(attacker)
# 毎ターン攻撃力+1
if attacker.card.state & 2 != 0 && attacker.jp < @jp_max
attacker.jp += 1
add_message(sprintf("Counter skill!! %s + 1", TMCARD::TX_ATK))
end
# 毎ターン攻撃力ï¼ï¼‘
if attacker.card.state & 4 != 0 && attacker.jp > 1
attacker.jp -= 1
add_message(sprintf("Counter skill!! %s - 1", TMCARD::TX_ATK))
end
end
#--------------------------------------------------------------------------
# â—‹ タイプボーナスã®é©ç”¨
#--------------------------------------------------------------------------
def apply_type_bonus(attacker, target)
if @type_bonus # å ´ã®ã‚¿ã‚¤ãƒ—ボーナスãŒæœ‰åŠ¹
a = attacker.card.type
b = target.card.type
if (a == 0 && b == 2) || (a == 1 && b == 0) ||
(a == 2 && b == 1) || (a == 3 && b == 3)
@damage += 1
add_message("Type Bonus!! Damage + 1", 7 + @turn)
end
end
end
#--------------------------------------------------------------------------
# â—‹ スキル発動ãƒã‚§ãƒƒã‚¯
#--------------------------------------------------------------------------
def check_skill
use_skill(@player[@turn].skill[3], @turn, 3)
(0...3).each do |i|
n = @player[@turn].lose - i
use_skill(@player[@turn].skill[n], @turn, n)
break if @player[@turn].card.state & 1 != 0
break if i == @player[@turn].lose
end
use_skill(@player[@turn ^ 1].skill[3], @turn ^ 1, 3)
(0...3).each do |i|
n = @player[@turn ^ 1].lose - i
use_skill(@player[@turn ^ 1].skill[n], @turn ^ 1, n)
break if @player[@turn ^ 1].card.state & 1 != 0
break if i == @player[@turn ^ 1].lose
end
end
#--------------------------------------------------------------------------
# â—‹ å‹æ•—判定
#--------------------------------------------------------------------------
def judge_win_loss
if game_end?
@auto_flag = false # オートフラグを倒ã™
add_message("Duel Over!!")
if @player[0].lose == 3 && @player[1].lose == 3
add_message("Draw")
$game_variables[TMCARD::VN_RESULT] = 0
elsif @player[0].lose == 3
add_message(sprintf("Defeat...", @player[1].name))
$data_system.gameover_me.play
$game_variables[TMCARD::VN_RESULT] = 1
else
add_message(sprintf("%s Wins", @player[0].name))
$game_system.battle_end_me.play
$game_variables[TMCARD::VN_RESULT] = 2
end
end
end
#--------------------------------------------------------------------------
# â—‹ 決ç€ãŒç€ã„ã¦ã„ã‚‹ã‹ã‚’è¿”ã™
#--------------------------------------------------------------------------
def game_end?
(@player[0].lose == 3 || @player[1].lose == 3)
end
#--------------------------------------------------------------------------
# â—‹ メッセージã®è¿½åŠ 
#--------------------------------------------------------------------------
def add_message(text, se = 0)
@player[0].jp = [[@player[0].jp, 1].max, @jp_max].min
@player[1].jp = [[@player[1].jp, 1].max, @jp_max].min
@message.push([text, se, @player[0].hp, @player[0].jp,
@player[1].hp, @player[1].jp])
end
#--------------------------------------------------------------------------
# â—‹ ãŸã¾ã£ã¦ã„るメッセージを返ã™
#--------------------------------------------------------------------------
def get_message
@message.shift
end
#--------------------------------------------------------------------------
# â—‹ マップBGMã‚’æµã™
#--------------------------------------------------------------------------
def play_map_bgm
@map_bgm.play
@map_bgs.play
end
end

#==============================================================================
# â–¡ Scene_Card
#==============================================================================
class Scene_Card < Scene_Base
#--------------------------------------------------------------------------
# ◠開始処ç†
#--------------------------------------------------------------------------
def start
super
create_background
@spriteset = Spriteset_Card.new
$game_duel.add_message(sprintf("Duel Start!! %s plays first",
$game_duel.active_player.name))
end
#--------------------------------------------------------------------------
# ◠終了処ç†
#--------------------------------------------------------------------------
def terminate
super
$game_duel.play_map_bgm
dispose_background
@spriteset.dispose
end
#--------------------------------------------------------------------------
# â—‹ 背景ã®ä½œæˆ
#--------------------------------------------------------------------------
def create_background
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
@background_sprite.color.set(16, 16, 16, 128)
end
#--------------------------------------------------------------------------
# â—‹ 背景ã®è§£æ”¾
#--------------------------------------------------------------------------
def dispose_background
@background_sprite.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新(基本)
#--------------------------------------------------------------------------
def update_basic
super
@spriteset.update
end
#--------------------------------------------------------------------------
# â—‹ メッセージ表示ãŒçµ‚ã‚ã‚‹ã¾ã§ã‚¦ã‚§ã‚¤ãƒˆ
#--------------------------------------------------------------------------
def wait_for_message
i = 0
while(i < TMCARD::AUTO_WAIT)
update_basic
break if Input.trigger?(:C) || Input.trigger?(:B)
if Input.trigger?(:A) # オートフラグ切替
Sound.play_ok
$game_duel.auto_flag = !$game_duel.auto_flag
break if $game_duel.auto_flag
end
i += 1 if $game_duel.auto_flag
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
$game_duel.update unless @spriteset.drawing?
super
update_message
(0...2).each do |i|
@spriteset.move_card(i) if $game_duel.player.refresh_move
end
end
#--------------------------------------------------------------------------
# â—‹ メッセージã®æ›´æ–°
#--------------------------------------------------------------------------
def update_message
message = $game_duel.get_message
while(message) # ãŸã¾ã£ã¦ã„るメッセージãŒãªããªã‚‹ã¾ã§ç¹°ã‚Šè¿”ã™
@spriteset.set_message(message[0])
case message[1]
when 5,6
user = message[1] - 5
@spriteset.start_animation(user, $game_duel.player[user].lose,
TMCARD::ANIME_SKILL)
when 7,8
user = message[1] - 7
@spriteset.start_animation(user, $game_duel.player[user].lose,
TMCARD::ANIME_BONUS)
end
$game_duel.player[0].hp_draw = message[2]
$game_duel.player[0].jp_draw = message[3]
$game_duel.player[1].hp_draw = message[4]
$game_duel.player[1].jp_draw = message[5]
wait_for_message
@spriteset.set_message("") # 表示メッセージを空ã«ã™ã‚‹
message = $game_duel.get_message # 次ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’å–å¾—
end
return_scene if $game_duel.game_end? # å‹è² ãŒã¤ã„ã¦ã„ã‚Œã°ã‚²ãƒ¼ãƒ çµ‚了
end
end

 

RPG::ITEM:

 

#==============================================================================
# â–  RPG::Item
#==============================================================================
class RPG::Item
#--------------------------------------------------------------------------
# â—‹ カードã‹ã©ã†ã‹ã‚’è¿”ã™
#--------------------------------------------------------------------------
def card?
/<(?:CARD)>/i =~ @note ? true : false
end
#--------------------------------------------------------------------------
# â—‹ コストを返ã™
#--------------------------------------------------------------------------
def c_cost
/<(?:COST)\s*(\d+)\s*>/i =~ @note ? $1.to_i : 1
end
#--------------------------------------------------------------------------
# â—‹ HPを返ã™
#--------------------------------------------------------------------------
def c_hp
/<(?:HP)\s*(\d+)\s*>/i =~ @note ? $1.to_i : 1
end
#--------------------------------------------------------------------------
# â—‹ 攻撃力を返ã™
#--------------------------------------------------------------------------
def c_atk
/<(?:ATK)\s*(\d+)\s*>/i =~ @note ? $1.to_i : 1
end
#--------------------------------------------------------------------------
# â—‹ タイプ値を返ã™
#--------------------------------------------------------------------------
def c_type
/<(?:TYPE)\s*(\d+)\s*>/i =~ @note ? $1.to_i : 0
end
#--------------------------------------------------------------------------
# â—‹ 属性値を返ã™
#--------------------------------------------------------------------------
def c_element
/<(?:ELEMENT)\s*(\d+)\s*>/i =~ @note ? $1.to_i : 0
end
#--------------------------------------------------------------------------
# â—‹ レアリティ値を返ã™
#--------------------------------------------------------------------------
def c_rare
/<(?:RARE)\s*(\d+)\s*>/i =~ @note ? $1.to_i : 0
end
#--------------------------------------------------------------------------
# â—‹ スキルを返ã™
#--------------------------------------------------------------------------
def c_skill(index)
if index == 0
skill_id = // =~ @note ? $1.to_i : 1
else
skill_id = // =~ @note ? $1.to_i : 1
end
$data_skills[skill_id]
end
end

#==============================================================================
# â–  RPG::Skill
#==============================================================================
class RPG::Skill
#--------------------------------------------------------------------------
# â—‹ 発動ターンを返ã™
#--------------------------------------------------------------------------
def c_turn
// =~ @note ? $1.to_i : 0
end
#--------------------------------------------------------------------------
# â—‹ 発動回数を返ã™
#--------------------------------------------------------------------------
def c_repeats
// =~ @note ? $1.to_i : 1
end
end

#==============================================================================
# â–  Window_MenuCommand
#==============================================================================
class Window_MenuCommand
#--------------------------------------------------------------------------
# ◠独自コマンドã®è¿½åŠ ç”¨
#--------------------------------------------------------------------------
alias tmcard_window_menucommand_add_original_commands add_original_commands
def add_original_commands
tmcard_window_menucommand_add_original_commands
if $game_switches[TMCARD::SW_USE_MENU_EDIT]
add_command(TMCARD::DECK_EDIT, :deck_edit, true)
end
if $game_switches[TMCARD::SW_USE_MENU_TEST]
add_command(TMCARD::DECK_TEST, :deck_test, true)
end
end
end

#==============================================================================
# â–¡ Window_CardCommand
#==============================================================================
class Window_CardCommand < Window_Selectable
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, TMCARD::WIDTH_STATUS_WINDOW, line_height * TMCARD::DECK_MAX + 24)
@index = 0
activate
refresh
end
#--------------------------------------------------------------------------
# ◠決定やキャンセルãªã©ã®ãƒãƒ³ãƒ‰ãƒªãƒ³ã‚°å‡¦ç†
#--------------------------------------------------------------------------
def process_handling
return unless open? && active
super
return process_description if handle?(:description) && Input.trigger?(:A)
end
#--------------------------------------------------------------------------
# ◠キャンセル処ç†ã®æœ‰åŠ¹çŠ¶æ…‹ã‚’å–å¾—
#--------------------------------------------------------------------------
def cancel_enabled?
result = super && (SceneManager.scene_is?(Scene_DeckEdit) ||
$game_switches[TMCARD::SW_CAN_CANCEL])
Sound.play_buzzer unless result
result
end
#--------------------------------------------------------------------------
# â—‹ 説明ボタンãŒæŠ¼ã•ã‚ŒãŸã¨ãã®å‡¦ç†
#--------------------------------------------------------------------------
def process_description
Input.update
call_handler(:description)
end
#--------------------------------------------------------------------------
# ◠項目数ã®å–å¾—
#--------------------------------------------------------------------------
def item_max
TMCARD::DECK_MAX
end
#--------------------------------------------------------------------------
# â— é¸æŠžé …ç›®ã®æœ‰åŠ¹çŠ¶æ…‹ã‚’å–å¾—
#--------------------------------------------------------------------------
def current_item_enabled?
return true if SceneManager.scene_is?(Scene_DeckEdit)
return false if $game_party.deck(@index).include?(0)
return false if SceneManager.scene_is?(Scene_DeckTest) &&
$game_party.deck($game_temp.card_enemy_index).include?(0)
true
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
#--------------------------------------------------------------------------
def draw_item(index)
w = self.contents.width - 8
text = sprintf("Deck%s", TMCARD::DECK_LETTER[index])
self.contents.font.color = normal_color
self.contents.draw_text(4, line_height * index, w, line_height, text)
text = sprintf("%d/%d", $game_party.cost(index),
$game_variables[TMCARD::VN_COST_MAX])
if $game_party.cost(index) == $game_variables[TMCARD::VN_COST_MAX]
change_color(knockout_color)
end
self.contents.draw_text(4, line_height * index, w, line_height, text, 2)
end
end

#==============================================================================
# â–¡ Window_CardEquip
#==============================================================================
class Window_CardEquip < Window_Selectable
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(x, y, start_index = 0)
super(x, y, Graphics.width - x, line_height * 3 + 24)
refresh(start_index)
end
#--------------------------------------------------------------------------
# ◠決定やキャンセルãªã©ã®ãƒãƒ³ãƒ‰ãƒªãƒ³ã‚°å‡¦ç†
#--------------------------------------------------------------------------
def process_handling
return unless open? && active
super
return process_description if handle?(:description) && Input.trigger?(:A)
end
#--------------------------------------------------------------------------
# â—‹ 説明ボタンãŒæŠ¼ã•ã‚ŒãŸã¨ãã®å‡¦ç†
#--------------------------------------------------------------------------
def process_description
Input.update
call_handler(:description)
end
#--------------------------------------------------------------------------
# ◠項目数ã®å–å¾—
#--------------------------------------------------------------------------
def item_max
return 3
end
#--------------------------------------------------------------------------
# â—‹ アイテムã®å–å¾—
#--------------------------------------------------------------------------
def item
@data[@index]
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh(deck_index = 0)
self.contents.clear
@data = []
$game_party.cards(deck_index).each {|item| @data.push(item) }
@item_max = @data.size
self.contents.font.color = system_color
self.contents.draw_text(4, line_height * 0, 48, line_height, "1st")
self.contents.draw_text(4, line_height * 1, 48, line_height, "2nd")
self.contents.draw_text(4, line_height * 2, 48, line_height, "3rd")
self.contents.font.color = normal_color
(0...3).each {|i| draw_item_name(@data, 48, line_height * i) }
end
end

#==============================================================================
# â–¡ Window_CardItem
#==============================================================================
class Window_CardItem < Window_Selectable
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(x, y, equip_window, command_window)
super(x, y, Graphics.width - x, Graphics.height - y)
set_handler(:sort, method(:change_sort_type))
@equip_window = equip_window
@command_window = command_window
@sort_type = 0
refresh
end
#--------------------------------------------------------------------------
# ◠項目数ã®å–å¾—
#--------------------------------------------------------------------------
def item_max
n = 1
$game_party.items.each {|item| n += 1 if include?(item) }
n
end
#--------------------------------------------------------------------------
# ◠決定やキャンセルãªã©ã®ãƒãƒ³ãƒ‰ãƒªãƒ³ã‚°å‡¦ç†
#--------------------------------------------------------------------------
def process_handling
return unless open? && active
super
return process_description if handle?(:description) && Input.trigger?(:A)
return process_sort if handle?(:sort) && Input.trigger?(:X)
end
#--------------------------------------------------------------------------
# â—‹ 説明ボタンãŒæŠ¼ã•ã‚ŒãŸã¨ãã®å‡¦ç†
#--------------------------------------------------------------------------
def process_description
Input.update
call_handler(:description)
end
#--------------------------------------------------------------------------
# â—‹ ソートボタンãŒæŠ¼ã•ã‚ŒãŸã¨ãã®å‡¦ç†
#--------------------------------------------------------------------------
def process_sort
Input.update
call_handler(:sort)
end
#--------------------------------------------------------------------------
# â— é¸æŠžé …ç›®ã®æœ‰åŠ¹çŠ¶æ…‹ã‚’å–å¾—
#--------------------------------------------------------------------------
def current_item_enabled?
enable?(item)
end
#--------------------------------------------------------------------------
# â—‹ アイテムã®å–å¾—
#--------------------------------------------------------------------------
def item
$data_items[@data[@index]]
end
#--------------------------------------------------------------------------
# â—‹ アイテムをリストã«å«ã‚ã‚‹ã‹ã©ã†ã‹
# item : アイテム
#--------------------------------------------------------------------------
def include?(item)
return false unless item
return false unless item.card?
true
end
#--------------------------------------------------------------------------
# â—‹ アイテムを許å¯çŠ¶æ…‹ã§è¡¨ç¤ºã™ã‚‹ã‹ã©ã†ã‹
# item : アイテム
#--------------------------------------------------------------------------
def enable?(item)
return true unless item
cost = $game_party.cost(@command_window.index)
last_item = $game_party.cards(@command_window.index)[@equip_window.index]
(cost - (last_item ? last_item.c_cost : 0) + item.c_cost <=
$game_variables[TMCARD::VN_COST_MAX])
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
@data = []
$game_party.items.each {|item| @data.push(item.id) if include?(item) }
sort
@data.push(0)
create_contents
(0...item_max).each {|i| draw_item(i) }
end
#--------------------------------------------------------------------------
# â—‹ ソートタイプã®å¤‰æ›´
#--------------------------------------------------------------------------
def change_sort_type
Sound.play_evasion
@sort_type = (@sort_type + 1) % 6
refresh
end
#--------------------------------------------------------------------------
# ○ データソート
#--------------------------------------------------------------------------
def sort
return if @sort_type == 0
@data.sort! do |a, b|
flag = false
item_a = $data_items[a]
item_b = $data_items
case @sort_type
when 1; # コスト順
item_a.c_cost <=> item_b.c_cost
when 2; # タイプ順
item_a.c_type <=> item_b.c_type
when 3; # 属性順
item_a.c_element <=> item_b.c_element
when 4; # HPé †
item_a.c_hp <=> item_b.c_hp
when 5; # 攻撃力順
item_a.c_atk <=> item_b.c_atk
end
end
end
#--------------------------------------------------------------------------
# â—‹ é …ç›®ã®æç”»
# index : 項目番å·
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = $data_items[@data[index]]
if item
number = $game_party.item_number(item)
enabled = enable?(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enabled)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end

#==============================================================================
# â–¡ Window_CardStatus
#==============================================================================
class Window_CardStatus < Window_Base
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, TMCARD::WIDTH_STATUS_WINDOW, Graphics.height - y)
hide
@card = 0
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
def dispose
super
@card_sprite.dispose if @card_sprite
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
super
@card_sprite.visible = self.visible if @card_sprite
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @card_sprite
@card_sprite.dispose
@card_sprite = nil
end
return if @card == 0
card = Game_Card.new(@card)
@card_sprite = Sprite_Card.new(card)
@card_sprite.x = self.x + padding + self.contents.width / 2 - 64
@card_sprite.y = self.y + padding
@card_sprite.z = self.z + 1
change_color(system_color)
w = self.contents.width - 8
h = line_height
self.contents.draw_text(4, 198, w, h, TMCARD::TX_COST)
self.contents.draw_text(4, 222, w, h, TMCARD::TX_HP +
"/" + TMCARD::TX_ATK)
self.contents.draw_text(4, 246, w, h, TMCARD::TX_TYPE +
"/" + TMCARD::TX_ELEMENT)
self.contents.draw_text(4, 270, w, h, TMCARD::TX_SKILL)
change_color(normal_color)
self.contents.draw_text(4, 198, w, h, card.cost, 2)
text = sprintf("%d / %d", card.hp, card.atk)
self.contents.draw_text(4, 222, w, h, text, 2)
text = TMCARD::TYPE_NAME[card.type]
text += " / " + TMCARD::ELEMENT_NAME[card.element]
self.contents.draw_text(4, 246, w, h, text, 2)
self.contents.draw_text(4, 296, w, h, "★" + card.skill(0).name, 2)
self.contents.draw_text(4, 320, w, h, "☆" + card.skill(1).name, 2)
end
#--------------------------------------------------------------------------
# ○ カード変更
#--------------------------------------------------------------------------
def set_new_card(id)
if @card != id
@card = id
refresh
end
end
end

#==============================================================================
# â–¡ Window_CardStatusEx
#==============================================================================
class Window_CardStatusEx < Window_Selectable
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, Graphics.width - x, Graphics.height - y)
hide
end
#--------------------------------------------------------------------------
# ◠決定やキャンセルãªã©ã®ãƒãƒ³ãƒ‰ãƒªãƒ³ã‚°å‡¦ç†
#--------------------------------------------------------------------------
def process_handling
return unless open? && active
super
return process_description if handle?(:description) && Input.trigger?(:A)
end
#--------------------------------------------------------------------------
# â—‹ 説明ボタンãŒæŠ¼ã•ã‚ŒãŸã¨ãã®å‡¦ç†
#--------------------------------------------------------------------------
def process_description
Input.update
Sound.play_ok
call_handler(:description)
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh(card)
self.contents.clear
draw_horz_line(224, line_height * 2)
draw_horz_line(0, line_height * 8)
change_color(system_color)
self.contents.draw_text(224, line_height * 0, 64, line_height, TMCARD::TX_NAME)
self.contents.draw_text(224, line_height * 1, 64, line_height, TMCARD::TX_RARE)
self.contents.draw_text(224, line_height * 3, 128, line_height, TMCARD::TX_COST)
self.contents.draw_text(224, line_height * 4, 128, line_height, TMCARD::TX_HP)
self.contents.draw_text(224, line_height * 5, 128, line_height, TMCARD::TX_ATK)
self.contents.draw_text(224, line_height * 6, 128, line_height, TMCARD::TX_TYPE)
self.contents.draw_text(224, line_height * 7, 128, line_height, TMCARD::TX_ELEMENT)
self.contents.draw_text(4, line_height * 9, 364, line_height, TMCARD::TX_SKILL)
change_color(normal_color)
self.contents.draw_text(288, line_height * 0, 192, line_height, card.name, 2)
text = TMCARD::RARE_NAME[card.c_rare]
self.contents.draw_text(288, line_height * 1, 192, line_height, text, 2)
self.contents.draw_text(224, line_height * 3, 128, line_height, card.c_cost, 2)
self.contents.draw_text(224, line_height * 4, 128, line_height, card.c_hp, 2)
self.contents.draw_text(224, line_height * 5, 128, line_height, card.c_atk, 2)
text = TMCARD::TYPE_NAME[card.c_type]
self.contents.draw_text(224, line_height * 6, 128, line_height, text, 2)
text = TMCARD::ELEMENT_NAME[card.c_element]
self.contents.draw_text(224, line_height * 7, 128, line_height, text, 2)
w = self.contents.width - 16
skill = card.c_skill(0)
self.contents.draw_text(4, line_height * 10, w, line_height, "★" + skill.name)
self.contents.draw_text(16, line_height * 11, w, line_height, skill.description)
skill = card.c_skill(1)
self.contents.draw_text(4, line_height * 12, w, line_height, "☆" + skill.name)
self.contents.draw_text(16, line_height * 13, w, line_height, skill.description)
end
#--------------------------------------------------------------------------
# ◠水平線ã®æç”»
#--------------------------------------------------------------------------
def draw_horz_line(x, y)
line_y = y + line_height / 2 - 1
contents.fill_rect(x, line_y, contents_width, 2, line_color)
end
#--------------------------------------------------------------------------
# ◠水平線ã®è‰²ã‚’å–å¾—
#--------------------------------------------------------------------------
def line_color
color = normal_color
color.alpha = 48
color
end
end

#==============================================================================
# â–  Scene_Menu
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ◠コマンドウィンドウã®ä½œæˆ
#--------------------------------------------------------------------------
alias tmcard_scene_menu_create_command_window create_command_window
def create_command_window
tmcard_scene_menu_create_command_window
@command_window.set_handler(:deck_edit, method(:command_deck_edit))
@command_window.set_handler(:deck_test, method(:command_deck_test))
end
#--------------------------------------------------------------------------
# ○ コマンド[デッキ編集]
#--------------------------------------------------------------------------
def command_deck_edit
SceneManager.call(Scene_DeckEdit)
end
#--------------------------------------------------------------------------
# ○ コマンド[模擬デュエル]
#--------------------------------------------------------------------------
def command_deck_test
SceneManager.call(Scene_DeckTest)
end
end

#==============================================================================
# â–¡ Scene_DeckEdit
#==============================================================================
class Scene_DeckEdit < Scene_MenuBase
#--------------------------------------------------------------------------
# ◠開始処ç†
#--------------------------------------------------------------------------
def start
super
@help_window = Window_Help.new(1)
@status_window = Window_CardStatus.new(0, @help_window.height)
@equip_window = Window_CardEquip.new(@status_window.width,
@help_window.height)
@equip_window.set_handler(:ok, method(:on_equip_ok))
@equip_window.set_handler(:cancel, method(:on_equip_cancel))
@equip_window.set_handler(:description, method(:open_status_ex))
@command_window = Window_CardCommand.new(0, @help_window.height)
@command_window.set_handler(:ok, method(:on_command_ok))
@command_window.set_handler(:cancel, method(:return_scene))
@item_window = Window_CardItem.new(@status_window.width,
@equip_window.y + @equip_window.height, @equip_window, @command_window)
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@item_window.set_handler(:description, method(:open_status_ex))
@status_ex_window = Window_CardStatusEx.new(0, @help_window.height)
@status_ex_window.set_handler(:ok, method(:close_status_ex))
@status_ex_window.set_handler(:cancel, method(:close_status_ex))
@status_ex_window.set_handler(:description, method(:close_status_ex))
@help_window.set_text("Please select the deck you want to edit")
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
last_command_index = @command_window.index
last_equip_index = @equip_window.index
super
unless @status_ex_window.visible
update_status_window
if @command_window.active
if last_command_index != @command_window.index
@equip_window.refresh(@command_window.index)
end
elsif @equip_window.active
@item_window.refresh if last_equip_index != @equip_window.index
end
end
end
#--------------------------------------------------------------------------
# â—‹ ステータスウィンドウã®æ›´æ–°
#--------------------------------------------------------------------------
def update_status_window
if @equip_window.active
deck = $game_party.deck(@command_window.index)
@status_window.set_new_card(deck[@equip_window.index])
elsif @item_window.active
id = @item_window.item ? @item_window.item.id : 0
@status_window.set_new_card(id)
end
end
#--------------------------------------------------------------------------
# ○ コマンド[決定]
#--------------------------------------------------------------------------
def on_command_ok
@command_window.hide
@status_window.show
@equip_window.activate
@equip_window.select(0)
text = sprintf("Deck%s Cost %d / %d",
TMCARD::DECK_LETTER[@command_window.index],
$game_party.cost(@command_window.index),
$game_variables[TMCARD::VN_COST_MAX])
@help_window.set_text(text)
end
#--------------------------------------------------------------------------
# â—‹ 装備部ä½é¸æŠžï¼»æ±ºå®šï¼½
#--------------------------------------------------------------------------
def on_equip_ok
@item_window.select(0)
@item_window.activate
end
#--------------------------------------------------------------------------
# â—‹ 装備部ä½é¸æŠžï¼»ã‚­ãƒ£ãƒ³ã‚»ãƒ«ï¼½
#--------------------------------------------------------------------------
def on_equip_cancel
@command_window.show.activate
@status_window.hide
@equip_window.index = -1
@help_window.set_text("Please select the deck you want to edit")
end
#--------------------------------------------------------------------------
# â—‹ アイテムé¸æŠžï¼»æ±ºå®šï¼½
#--------------------------------------------------------------------------
def on_item_ok
item = @item_window.item
Sound.play_equip
$game_party.change_card(@command_window.index, @equip_window.index, item)
@equip_window.activate
@equip_window.refresh(@command_window.index)
@item_window.refresh
@item_window.unselect
@command_window.refresh
text = sprintf("Deck%s Cost %d / %d",
TMCARD::DECK_LETTER[@command_window.index],
$game_party.cost(@command_window.index),
$game_variables[TMCARD::VN_COST_MAX])
@help_window.set_text(text)
end
#--------------------------------------------------------------------------
# â—‹ アイテムé¸æŠžï¼»ã‚­ãƒ£ãƒ³ã‚»ãƒ«ï¼½
#--------------------------------------------------------------------------
def on_item_cancel
@equip_window.activate
@item_window.index = -1
end
#--------------------------------------------------------------------------
# â—‹ ステータスEXウィンドウを開ã
#--------------------------------------------------------------------------
def open_status_ex
if @equip_window.active
item = $game_party.cards(@command_window.index)[@equip_window.index]
else
item = @item_window.item
end
if item
Sound.play_ok
@status_ex_window.refresh(item)
@status_ex_window.show.activate
@status_window.x = Graphics.width
@equip_window.hide.deactivate
@item_window.hide.deactivate
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# â—‹ ステータスEXウィンドウを閉ã˜ã‚‹
#--------------------------------------------------------------------------
def close_status_ex
@status_ex_window.hide
@status_window.x = 0
@equip_window.show
@item_window.show
(@item_window.index == -1 ? @equip_window : @item_window).activate
end
end

 

SCENE_CARDTEST:

 

#==============================================================================
# â–  Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :card_enemy_deck # 対戦相手ã®ãƒ‡ãƒƒã‚­
attr_accessor :card_enemy_name # 対戦相手ã®åå‰
attr_accessor :card_enemy_index # 模擬デュエル相手ã®ãƒ‡ãƒƒã‚­
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias tmcard_game_temp_initialize initialize
def initialize
tmcard_game_temp_initialize
@card_enemy_deck = []
@card_enemy_name = ""
@card_enemy_index = 1
end
end

#==============================================================================
# â–¡ Window_CardEnemy
#==============================================================================
class Window_CardEnemy < Window_Selectable
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(enemy)
super(0, 0, Graphics.width - TMCARD::WIDTH_STATUS_WINDOW, line_height * 3 + 24)
@enemy = enemy
refresh
end
#--------------------------------------------------------------------------
# ◠項目数ã®å–å¾—
#--------------------------------------------------------------------------
def item_max
return 3
end
#--------------------------------------------------------------------------
# â—‹ アイテムã®å–å¾—
#--------------------------------------------------------------------------
def item
@data[self.index]
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@enemy.each {|id| @data.push($data_items[id]) }
change_color(system_color)
self.contents.draw_text(4, line_height * 0, 48, line_height, "1st")
self.contents.draw_text(4, line_height * 1, 48, line_height, "2nd")
self.contents.draw_text(4, line_height * 2, 48, line_height, "3rd")
change_color(normal_color)
(0...3).each {|i| draw_item_name(@data, 48, line_height * i) }
end
end

#==============================================================================
# â–¡ Scene_DeckSelect
#==============================================================================
class Scene_DeckSelect < Scene_MenuBase
#--------------------------------------------------------------------------
# ◠開始処ç†
#--------------------------------------------------------------------------
def start
super
@help_window = Window_Help.new(1)
@help_window.set_text("Please select a deck you want to use")
@command_window = Window_CardCommand.new(0, @help_window.height)
@command_window.set_handler(:ok, method(:on_command_ok))
@command_window.set_handler(:cancel, method(:return_scene))
@equip_window = Window_CardEquip.new(@command_window.width,
@help_window.height)
create_enemy_window
setup_window_position
end
#--------------------------------------------------------------------------
# â—‹ 対戦相手ã®ãƒ‡ãƒƒã‚­ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’作æˆã™ã‚‹
#--------------------------------------------------------------------------
def create_enemy_window
$game_variables[TMCARD::VN_RESULT] = 3 # çµæžœå¤‰æ•°ã®åˆæœŸåŒ–
@enemy_deck = $game_temp.card_enemy_deck
@enemy_name = $game_temp.card_enemy_name
@enemy_window = Window_CardEnemy.new(@enemy_deck)
end
#--------------------------------------------------------------------------
# â—‹ ウィンドウã®ä½ç½®ã‚’調整ã™ã‚‹
#--------------------------------------------------------------------------
def setup_window_position
if @command_window.height + @help_window.height <= (Graphics.height -
@enemy_window.height)
x = (Graphics.width - @enemy_window.width) / 2
if @command_window.height > @equip_window.height
y = @help_window.height + @command_window.height
else
y = @help_window.height + @equip_window.height
end
else
x = @command_window.width
y = @help_window.height + @equip_window.height
end
@enemy_window.x = x
@enemy_window.y = (Graphics.height - y - @enemy_window.height) / 2 + y
end
#--------------------------------------------------------------------------
# ○ コマンド[決定]
#--------------------------------------------------------------------------
def on_command_ok
$game_party.set_active_deck(@command_window.index)
$game_duel = Game_Duel.new unless $game_duel
$game_duel.setup(@enemy_deck, @enemy_name)
SceneManager.goto(Scene_Card)
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
last_command_index = @command_window.index
super
if last_command_index != @command_window.index
@equip_window.refresh(@command_window.index)
end
end
end

#==============================================================================
# â–¡ Scene_DeckTest
#==============================================================================
class Scene_DeckTest < Scene_DeckSelect
#--------------------------------------------------------------------------
# â—‹ 対戦相手ã®ãƒ‡ãƒƒã‚­ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’作æˆã™ã‚‹
#--------------------------------------------------------------------------
def create_enemy_window
@command_window.set_handler(:description, method(:set_enemy_deck))
$game_temp.card_enemy_index = 1
@enemy_window = Window_CardEquip.new(@command_window.width, 0, 1)
end
#--------------------------------------------------------------------------
# ○ コマンド[決定]
#--------------------------------------------------------------------------
def on_command_ok
$game_party.set_active_deck(@command_window.index)
$game_duel = Game_Duel.new unless $game_duel
$game_duel.setup($game_party.deck($game_temp.card_enemy_index),
"Deck" + TMCARD::DECK_LETTER[$game_temp.card_enemy_index])
SceneManager.goto(Scene_Card)
end
#--------------------------------------------------------------------------
# â—‹ 対戦相手ã®æ±ºå®š
#--------------------------------------------------------------------------
def set_enemy_deck
if $game_party.deck(@command_window.index).include?(0)
Sound.play_buzzer
else
Sound.play_ok
$game_temp.card_enemy_index = @command_window.index
@enemy_window.refresh($game_temp.card_enemy_index)
end
@command_window.activate
end
end

 

CARD SKILLS:

(Note that I put spaces between each script command below for those who have sensitive eyes.)

 

#==============================================================================
# â–¡ Game_Duel
#==============================================================================
class Game_Duel
#--------------------------------------------------------------------------
# ○ スキル使用
#--------------------------------------------------------------------------
def use_skill(skill, user, card)
return unless skill # スキルãŒãªã‘ã‚Œã°çµ‚了
return unless conditions_met?(skill, user, card) # 発動æ¡ä»¶åˆ¤å®š
if // =~ skill.note
id = $1.to_i
param = $2.to_i
end
enemy = user ^ 1
p_name = @player[user].card.name
e_name = @player[enemy].card.name
case id\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 1 # Damage to the opponent + n
@damage = [@damage + param, 0].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("Damage %s %d", param < 0 ? "-" : "+",
param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 2 # Damage to the opponent is doubled
@damage *= 2
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message("Damage doubled")\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 3 # Damage from opponent +n
@damage = [@damage + param, 0].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("Damage from %s %d", param < 0 ? "-" : "+",
param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 4 # Damage from opponent is halved
@damage /= 2
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message("Damaged halved")\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 5 # Disable inheritance
@player[enemy].card.add_state(1)
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's inherited skills are disabled!", e_name))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 6 # skip opponent's attack phase
@phase = 2
add_message(sprintf("%s 's %s activated!!", p_name, skill.name), 5 + user)
add_message("Attack Phase Skipped")\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 7 # HP + n
@player[user].hp = [@player[user].hp + param, 0].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s %s %d", TMCARD::TX_HP, param < 0 ? "-" : "+",
param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 8 # ATK + n based on self type
@player[user].jp += param
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s %s %d", TMCARD::TX_ATK, param < 0 ? "-" : "+",
param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 9 # n to your attack power
@player[user].jp = param
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s is now %d", TMCARD::TX_ATK, param))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 10 # Ally's HP+n
@player[enemy].hp = [@player[enemy].hp + param, 0].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's%s %s %d", e_name, TMCARD::TX_HP,
param < 0 ? "-" : "+", param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 11 # Opponent's attack power + n
@player[enemy].jp += param
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's%s %s %d", e_name, TMCARD::TX_ATK,
param < 0 ? "-" : "+", param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 12 # n force to an opponent's attack
@player[enemy].jp = param
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's%s is now %d", e_name, TMCARD::TX_ATK, param))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 13 # n max the attack (1 = User / 2 = Enemy)
if param == 1
@player[user].jp = @jp_max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's %s is Maximum!", p_name, TMCARD::TX_ATK))
else
@player[enemy].jp = @jp_max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's %s is Maximum", e_name, TMCARD::TX_ATK))
end\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 14 # Damage to your HP - n, give + n
@damage = [@damage + param, 0].max
@player[user].hp = [@player[user].hp - param, 0].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("Damage %s %d / %s %s %d", param < 0 ? "-" : "+",
param.abs, TMCARD::TX_HP, param < 0 ? "+" : "-", param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 15 # 自分ã¨ç›¸æ‰‹ã®â—‹â—‹ã‚’入れ替ãˆã‚‹ï¼ˆ1 = HP / 2 = ATK)
if param == 1
@player[user].hp, @player[enemy].hp = @player[enemy].hp, @player[user].hp
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s replaced", TMCARD::TX_HP))
else
@player[user].jp, @player[enemy].jp = @player[enemy].jp, @player[user].jp
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s replaced", TMCARD::TX_ATK))
end\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 16 # 自分ã¨ç›¸æ‰‹ã®â—‹â—‹ã‚’å¹³å‡åŒ–(1 = HP / 2 = 攻撃力)
if param == 1
n = (@player[user].hp + @player[enemy].hp) / 2
@player[user].hp = @player[enemy].hp = n
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s averaged", TMCARD::TX_HP))
else
n = (@player[user].jp + @player[enemy].jp) / 2
@player[user].jp = @player[enemy].jp = n
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s averaged", TMCARD::TX_ATK))
end\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 17 # 相手ã«â—‹â—‹ã®ãƒ€ãƒ¡ãƒ¼ã‚¸
@player[enemy].hp = [@player[enemy].hp - param, 0].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s took %d damage", e_name, param))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 18 # 自分ã¨ç›¸æ‰‹ã«â—‹â—‹ã®ãƒ€ãƒ¡ãƒ¼ã‚¸
@player[user].hp = [@player[user].hp - param, 0].max
@player[enemy].hp = [@player[enemy].hp - param, 0].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s and %s took %d damage", p_name, e_name, param))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 20 # 自分ã®ç¶™æ‰¿ã‚¹ã‚­ãƒ«ã‚’相手ã¨åŒã˜ã«ã™ã‚‹
@player[user].skill[card] = @player[enemy].skill[@player[enemy].lose]
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("Copied %s skill", TMCARD::TX_SKILL))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 21 # 相手ã®ç¶™æ‰¿ã‚¹ã‚­ãƒ«ã‚’奪ã†
@player[user].skill[card] = @player[enemy].skill[@player[enemy].lose]
@player[enemy].skill[@player[enemy].lose] = nil
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("Inheritance stolen", TMCARD::TX_SKILL))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 22 # 相手ã®ç¶™æ‰¿ã‚¹ã‚­ãƒ«ã‚’â—‹â—‹ã«ã™ã‚Šã‹ãˆã‚‹
@player[enemy].skill[@player[enemy].lose] = $data_skills[param]
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's Inheritance %s became %s", e_name, TMCARD::TX_SKILL,
$data_skills[param].name))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 23 # 相手ã®å›ºæœ‰ã‚¹ã‚­ãƒ«ã‚’â—‹â—‹ã«ã™ã‚Šã‹ãˆã‚‹
@player[enemy].skill[3] = $data_skills[param]
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's Specific %s became %s", e_name, TMCARD::TX_SKILL,
$data_skills[param].name))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 24 # 使用済ã¿ã‚¹ã‚­ãƒ«ãŒå¾©æ´»ã™ã‚‹
(0..3).each {|i| @player[user].skill_cnt = 0 }
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's %s recovered", p_name, TMCARD::TX_SKILL))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 25 # Disables type bonus
@type_bonus = false
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message("Type bonus disabled!")\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 26 # After attack change n to limit
@jp_max = param
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s changed %d limit", TMCARD::TX_ATK, param))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 27 # 以é™ã®æ”»æ’ƒåŠ›ä¸Šé™ï¼‹â—‹â—‹
@jp_max = [@jp_max + param, 1].max
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s limit %s %d", TMCARD::TX_ATK, param < 0 ? "-" : "+",
param.abs))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 28 # Limit the attack power
@jp_max = @player[user].jp
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s changed %d limit", TMCARD::TX_ATK, @jp_max))\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 29 # 攻撃力を1ã«ã™ã‚‹ãŒã€æ¯Žã‚¿ãƒ¼ãƒ³æ”»æ’ƒåŠ›ï¼‹ï¼‘(1 = 自分 / 2 = 相手)
if param == 1
@player[user].jp = 1
@player[user].card.add_state(2)
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's %s became 1", p_name, TMCARD::TX_ATK))
else
@player[enemy].jp = 1
@player[enemy].card.add_state(2)
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's %s became 1", e_name, TMCARD::TX_ATK))
end\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 30 # 攻撃力を最大ã«ã™ã‚‹ãŒã€æ¯Žã‚¿ãƒ¼ãƒ³æ”»æ’ƒåŠ›ï¼ï¼‘(1 = 自分 / 2 = 相手)
if param == 1
@player[user].jp = @jp_max
@player[user].card.add_state(4)
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's %s became Maximum", p_name, TMCARD::TX_ATK))
else
@player[enemy].jp = @jp_max
@player[enemy].card.add_state(4)
add_message(sprintf("%s's %s activated!!", p_name, skill.name), 5 + user)
add_message(sprintf("%s's %s became Maximum", e_name, TMCARD::TX_ATK))
end
end
@player[user].skill_cnt[card] += 1 # スキル発動回数加算
@player[user].used_skill[card] = true # スキル発動済ã¿ãƒ•ãƒ©ã‚°ã‚’ç«‹ã¦ã‚‹
end
#--------------------------------------------------------------------------
# â—‹ 発動æ¡ä»¶ãƒã‚§ãƒƒã‚¯
#--------------------------------------------------------------------------
def conditions_met?(skill, user, card)
return false unless effect_conditions_met?(skill, user)
unless skill.c_repeats == 0 || @player[user].skill_cnt[card] < skill.c_repeats
return false # 発動回数制é™
end
unless skill.c_turn == 0 || @player[user].card.turn == skill.c_turn
return false # 発動ターン制é™
end
return false if @player[user].used_skill[card] # åŒã‚¿ãƒ¼ãƒ³å†…発動制é™
enemy = user ^ 1
skill.note.each_line do |line|
if // =~ line
param = $2.to_i
case $1.to_i\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 2 # 相手ãŒâ—‹â—‹ã‚¿ã‚¤ãƒ—
return false unless @player[enemy].type == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 3 # 相手ãŒâ—‹â—‹å±žæ€§
return false unless @player[enemy].element == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 4 # 相手ã®ãƒ¬ã‚¢ãƒªãƒ†ã‚£ãŒâ—‹â—‹
return false unless @player[enemy].rare == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 5 # 相手ã®ãƒã‚¸ã‚·ãƒ§ãƒ³ãŒâ—‹â—‹
return false unless @player[enemy].lose == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 6 # 相手ã®ï¼¨ï¼°ãŒâ—‹â—‹ä»¥ä¸Š
return false unless @player[enemy].hp >= param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 7 # 相手ã®ï¼¨ï¼°ãŒâ—‹â—‹ä»¥ä¸‹
return false unless @player[enemy].hp <= param && @player[enemy].hp > 0\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 8 # 相手ã®ï¼¨ï¼°ãŒâ—‹â—‹ã«ãªã£ãŸ
return false unless @player[enemy].hp == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 9 # 相手ã®ï¼¨ï¼°ãŒâ—‹â—‹ï¼ˆ0 = å¶æ•° / 1 = 奇数)
return false unless @player[enemy].hp % 2 == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 10 # 相手ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ä»¥ä¸Š
return false unless @player[enemy].jp >= param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 11 # 相手ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ä»¥ä¸‹
return false unless @player[enemy].jp <= param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 12 # 相手ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ã«ãªã£ãŸ
return false unless @player[enemy].jp == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 13 # 相手ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ï¼ˆ1 = 奇数 / 2 = å¶æ•°ï¼‰
return false unless @player[enemy].jp % 2 == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 14 # 自分ãŒâ—‹â—‹ã‚¿ã‚¤ãƒ—
return false unless @player[user].type == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 15 # 自分ãŒâ—‹â—‹å±žæ€§
return false unless @player[user].element == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 16 # 自分ã®ãƒ¬ã‚¢ãƒªãƒ†ã‚£ãŒâ—‹â—‹
return false unless @player[user].rare == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 17 # 自分ã®ãƒã‚¸ã‚·ãƒ§ãƒ³ãŒâ—‹â—‹
return false unless @player[user].lose == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 18 # 自分ã®ï¼¨ï¼°ãŒâ—‹â—‹ä»¥ä¸Š
return false unless @player[user].hp >= param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 19 # 自分ã®ï¼¨ï¼°ãŒâ—‹â—‹ä»¥ä¸‹
return false unless @player[user].hp <= param && @player[user].hp > 0\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 20 # 自分ã®ï¼¨ï¼°ãŒâ—‹â—‹ã«ãªã£ãŸ
return false unless @player[user].hp == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 21 # 自分ã®ï¼¨ï¼°ãŒâ—‹â—‹ï¼ˆ1 = 奇数 / 2 = å¶æ•°ï¼‰
return false unless @player[user].hp % 2 == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 22 # 自分ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ä»¥ä¸Š
return false unless @player[user].jp >= param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 23 # 自分ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ä»¥ä¸‹
return false unless @player[user].jp <= param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 24 # 自分ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ã«ãªã£ãŸ
return false unless @player[user].jp == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 25 # 自分ã®æ”»æ’ƒåŠ›ãŒâ—‹â—‹ï¼ˆ1 = 奇数 / 2 = å¶æ•°ï¼‰
return false unless @player[user].jp % 2 == param\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 26 # 攻撃ã•ã‚ŒãŸã¨ã
return false unless @turn == enemy && @phase == 2\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 27 # 攻撃ã—ãŸã¨ã
return false unless @turn == user && @phase == 2\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 28 # 自分ãŒâ—‹â—‹ã‚’継承ã—ã¦ã„ã‚‹
flag = false\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
(0..card).each do |i|
flag = true if @player[user].skill.id == param
end
return false unless flag\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 29 # 自分ã®ã‚³ã‚¹ãƒˆãŒç›¸æ‰‹ã‚ˆã‚Šä½Žã„
return false unless @player[user].cost < @player[enemy].cost\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 30 # 自分ã®ã‚³ã‚¹ãƒˆãŒç›¸æ‰‹ã‚ˆã‚Šé«˜ã„
return false unless @player[user].cost > @player[enemy].cost\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 31 # 自デッキã®ã‚¿ã‚¤ãƒ—ãŒçµ±ä¸€ã•ã‚Œã¦ã„ã‚‹
unless @player[user].type(0) == @player[user].type(1) &&
@player[user].type(1) == @player[user].type(2)
return false
end\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 32 # 自デッキã®å±žæ€§ãŒçµ±ä¸€ã•ã‚Œã¦ã„ã‚‹
unless @player[user].element(0) == @player[user].element(1) &&
@player[user].element(1) == @player[user].element(2)
return false
end\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 33 # 自デッキã®ã‚³ã‚¹ãƒˆãŒâ—‹â—‹ä»¥ä¸Š
unless @player[user].cost(0) + @player[user].cost(1) +
@player[user].cost(2) >= param
return false
end\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 34 # 自デッキã®ã‚³ã‚¹ãƒˆãŒâ—‹â—‹ä»¥ä¸‹
unless @player[user].cost(0) + @player[user].cost(1) +
@player[user].cost(2) <= param
return false
end
end
end
end
true
end
#--------------------------------------------------------------------------
# â—‹ スキル効果ã®å›ºå®šæ¡ä»¶åˆ¤å®š
#--------------------------------------------------------------------------
def effect_conditions_met?(skill, user)
if // =~ skill.note
effect_id = $1.to_i
effect_param = $2.to_i
else
return false # 効果ãŒè¨­å®šã•ã‚Œã¦ã„ãªã„
end
enemy = user ^ 1
case effect_id\s*(\d+)\s*\,\s*(\-*\d+)\s*>\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 1, 2, 14
(@turn == user && @phase == 1) # 自ターンã®è¨ˆç®—フェイズ\s*(\d+)\s*\,\s*(\-*\d+)\s*>\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 3, 4
(@turn == enemy && @phase == 1) # 相手ターンã®è¨ˆç®—フェイズ\s*(\d+)\s*\,\s*(\-*\d+)\s*>\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 17, 18
(@turn == user && @phase == 0) # 自ターンã®æº–備フェイズ\s*(\d+)\s*\,\s*(\-*\d+)\s*>\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 6
(@turn == enemy && @phase == 0) # 相手ターンã®æº–備フェイズ\s*(\d+)\s*\,\s*(\-*\d+)\s*>\s*(\d+)\s*\,\s*(\d+)\s*>\s*(\d+)\s*\,\s*(\-*\d+)\s*>
 

when 19
(@phase == 2) # åŒæ–¹ã®ã‚¿ãƒ¼ãƒ³ã®æ”»æ’ƒãƒ•ã‚§ã‚¤ã‚º
else
true
end
end
end

 

 

Now i'll give you a brief summary of what the script does(or should i say what the card battle is like), but i'll do it with images and try to explain the process(and note that i'm not in anyway calling anyone here so dumb that they can't read the script cause im not):

 

 

post-26145-0-36451700-1417022306_thumb.png

Here is what the battle screen looks like. You have the two big pictures of cards(1 for you and one for your oppnent), which is the active cards, and the 4 smaller sized cards(2 for you and 2 for your opponent), which are your benched cards. Now let me explain the way the battle works. first off, the whole battle is automatic so there is absolutely no commands that you can make during the battle cause the script does it itself. This is the one thing i want to change in the script. The whole automatic battle is ok and all, but i want to be able to make my own commands. and secondly there is no hand pile or whatever you call it. that is another thing i want to change. Now there is a third thing, but I'll describe that later.

post-26145-0-98630000-1417022762_thumb.png

This is the menu. As you see, the menu has all of the default menus you can access. Only thing different is that there are two more menus selections you can access: Deck Edit, and Deck Test. Deck edit lets you edit your deck. The maximum number of decks you can have are 5 and you can edit anyone of them! You can however change the maximum number of decks you can have as seen in the "Settings" script, but i dont plan to change that. Deck test... I havent tried that out yet but i believe that that basically lets you play an opponent that the script randomly generates in order to test your deck, but i could be wrong. But other than that, the menu is fine how it is and so i have no need to change that.

post-26145-0-53003400-1417023343_thumb.png

When you click on Deck Edit and then choose what ever deck you want to edit, the following image above will be shown. I have marked parts of the image with points and guidelines:

  • Point A: This is the window displaying the amount of... Well, it says cost but I don't know if it costs SP or something else, but i do know it isnt talking about money. But whatever the cost is, this window shows the amount of cost there is out of 10.
  • Point B: Remember when i told you guys earlier that there was a third thing i wanted to change about the battle process? Well this is where that all comes in. This window shows you how many are in the deck and as you can see, only three cards can be in a deck. That has to change! My personal opinion, three cards is no where near fun when it comes to playing card games. Instead of 3 cards, i want about 60 cards in each deck. Sound reasonable?
  • Point C: This window is the card status window. it displays the picture of the card along with the cards details such as cost,(Once again, i have no idea what that means) HP/atk, etc!
  • Point D: This window displays how many cards you have by card name with the number of its copy in your possesion right beside it.

 

 

Now thats describing what i want to change on the script. Now as for the rules of the game that i want it to follow and all that, you can view that in my game page by Clicking Here! But other than that, I really hope someone will help me with this project. It will be so huge and awesome that i'm sure everyone will want to play it! I just need a script writer (As many script writer as possible so no one has to rewrite the script by theirself.) and some artists who can make awesome character portraits for vx ace and who can also help with the making cards. I already have card frames for the cards, i just need some really good pictures to put into them. any help with this and I will make it worth your while.

Edited by shadow7396

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...