Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################################################################################
- #################################################################################
- # IXFURU SCENE DICE
- ##################################################################################
- # This script calls a scene which executes a dice roll at the given amount of
- # dice, specified in a variable. It's bulky, and uses 5 game variables and
- # 7 game switches. To use, you need to setup the constants in CONFIG1 section,
- # if you add or delete from the D6 constants section of CONFIG1, you'll have to
- # also modify CONFIG2 (line 667) to match it. You'll also need to switch out iconsets in
- # the Graphics/System folder with the one in the demo, or just find some
- # icons of dice and change the images appropriately starting at line 99.
- # Once you've set it up how you want it, just call the scene by putting:
- # $scene = Scene_Dice.new
- # in a script command (third page of the event commands)
- #
- # SOME EXAMPLES: (D6 means six-sided die)
- #
- # 3D6 + 4 Setup-> VROLL variable at 3, VADDR variable at 4,
- # This will call for a roll of 3 dice,
- # and add 4 to it for the total.
- #
- # 6D6 + 2D6 Setup-> VROLL variable at 6
- # VADDR variable at 2
- # Turn AIRSWITCH on
- # This will call for a 6D6 roll,
- # followed by a 2D6 roll, with the
- # 2D6 roll added to the initial.
- #
- # 2D6 x 12 Setup-> VROLL variable at 2, VMULT variable at 12
- # This will call a 2D6 roll, the value will
- # will be multiplied by 12.
- #
- # LIMITATIONS:
- # Though it is possible to do (4D6 x 2D6) + 3, it is not possible to do
- # (7D6 + 4) x 7. The multiplier MUST come before the adder and the
- # bonus roll. A fair replacement would be (7D6 + 4) + 7D6.
- # Also, you cannot have more than 10D6 on a given roll.
- #
- # In closing, just remember to set up the roll prior to calling the scene by
- # adjusting necessary switches and variables.
- #################################################################################
- #
- # Please credit me if you use this script. Feel free to contact me in my
- # subforum at RPGMakerVX.net, called "THE FINISH LINE". You can also PM
- # me with any questions regarding the script, or post in the script topic.
- # If you want to use this commercially, credit MUST be given. Also, please
- # link me to your project so I can check it out. Thanks and Enjoy!
- #
- #################################################################################
- ##################################################################################'
- # CONFIG1
- ###################################################################################
- module NQ
- #Window_Dice Constants
- # NOTE on the first 7 strings found here:
- # It is advised that if you change any of these, you make the string a short
- # one. As the size of these strings greatly effect how the dice are displayed
- # on a given roll. A string too long can cause some dice run out the side of
- # the window.
- DRINSTRUCT = "ROLL THE DICE" #string displayed at top of dice window
- DCOUNT = "ROLL" #first string displayed on left margin; amount
- # of dice to roll
- DMULTIPLIER = "ROLL X" #second string on left margin; value count
- # is multiplied by
- DADDER = "ROLL +" #third string on left margin; value to be added
- # to count
- DROLLBONUS = "BONUS" #fourth string on left margin; conditional value
- #to be added to count
- DTOTAL = "ROLL TOTAL" #final string on left margin; total of roll with
- # all values added
- DBONUS = "ALL THE SAME BONUS" #string at bottom of dice window, only appears
- #if all dice are the same on rolls of 3 or
- # more. If these conditions are met, the
- # total count is doubled.
- DRINSTRUCT_COLOR = 18 #must be integer above 0 and less than 31, changes color
- # of the DRINSTRUCT string above.
- USE_DOUBLER = true ##SET THIS TO 'false' if you don't want the doubler active
- # this will make it so that DBONUS is never written.
- MIN_DOUBLER = 3 #This number is the least amount of dice that can be rolled,
- #to enact doubler bonus. This is only in effect if the
- #USE_DOUBLER is true. This prevents doubling of rolls with
- #less than value given here.
- #Dice Variables; You'll need to pass the variables VROLL, VMULT, VADDR and
- # VRBNS into the scene. Set the variables pre scene call.
- VROLL = 11 #Variable that holds the amount of dice to roll
- VMULT = 12 #Variable that holds the amount to multiply roll by
- VADDR = 13 #Variable that holds the amount to add to the roll
- VRBNS = 14 #Variable that holds any conditional value to add
- VTRLL = 15 #Variable that holds total of the roll; this is the value you can
- # pass back to the scene or game you're creating.
- #-----------------------------------------------------------------------------------
- MIRSWITCH = 16 #This is an in game switch which verifies if dice should be rolled
- # to determine the multiplier. If switch is OFF, value of
- # multiplier is straight value; if ON a roll of the amount
- # of dice equal to the multiplier variable is required.
- AIRSWITCH = 17 #This is an in game switch which is used to determine if a
- # roll is required for the adder.
- BIRSWITCH = 18 #This is an in game switch which is used to determine if a
- # roll is required for the Roll Bonus.
- #----------------------------------------------------------------------------------
- #These values make reference to the Iconset in Graphics/System
- # folder. This is used in displaying the dice. You need to
- # set these values to the icon from the iconset you wish to
- # display the dice at each side. DIE5 for example, will show
- # if the player rolls a 5. DIESTILL is just which icon you
- # wish to display when the die is sitting still at the beginning
- # of the scene.
- DIESTILL = 3828 # still dice icon
- DIE1 = 1410 #when 1 is rolled
- DIE2 = 1411 #when 2 is rolled...
- DIE3 = 1412
- DIE4 = 1413
- DIE5 = 1414
- DIE6 = 1415
- #These are the Sound Effects played during different parts of the scene.
- ROLLING_SE = 'Earth9'
- SET_DICE_SE = 'Battle2'
- TALLY_LINES_SE = 'Saint5'
- TOTAL_GIVEN_SE = 'Chime2'
- DOUBLER_SE = 'Absorb2'
- INPUT_TO_ROLL = Input::C #input button used to activate the roll
- #=============================================================================
- #Window_D6 Constants;
- #These are the strings which will show in the D6 Window.
- #Basically, they just explain why you're making the current roll.
- #YOU SHOULD LIMIT THESE STRINGS TO 11 LETTERS!
- RTYPE_1 = "SKILL"
- RTYPE_2 = "PROFICIENCY"
- RTYPE_3 = "ATTACKING"
- RTYPE_4 = "EFFECTS"
- RTYPE_5 = "FOR ITEM"
- RTYPE_6 = "GAMBLING"
- RTYPE_7 = "ROPE BREAK"
- RTYPE_8 = "CHANCE"
- RTYPE_9 = "SURPRISE"
- RTYPE_10 = "HEALING"
- VRTYP = 16 #Variable which defines which of the 'RTYPE' string constants
- # to display. You'll need to set the CONFIG2 section up
- # if you plan on creating new ones, or subtracting from
- # those that already exist. WARNING: If you add or
- # subtract from the D6 Constants above, you must also,
- # add/subtract them from CONFIG2 section beginning at
- # line 667.
- VSTAT = 17 #Variable that holds a relevant target value. It will be displayed
- # beneath the RTYPE string in parenteses, if it's used.
- VSTATSWITCH = 15 #Target Value Switch; This is an in game switch which will be used to show/hide
- #the value in VSTAT constant. If turned on, it will display the stat, if
- #turned off, it won't.
- end
- ###################################################################################
- # END CONFIG1
- #
- # Please don't edit anything beyond here, unless you need to edit the
- # CONFIG2 section explained above and found at line 697
- #
- ##################################################################################
- class Window_Dice < Window_Base
- #------------------------------------------------------------------------------
- # Public Instance Variables
- #------------------------------------------------------------------------------
- attr_accessor :rollbonus
- attr_accessor :roll_complete
- attr_accessor :multiroll_complete
- attr_accessor :adderroll_complete
- attr_accessor :bonusroll_complete
- attr_accessor :roll_values
- attr_accessor :multi_values
- attr_accessor :adder_values
- attr_accessor :bonus_values
- attr_accessor :dieplacex
- attr_accessor :dieplacey
- attr_accessor :quickdraw
- attr_accessor :rollbonus
- def initialize
- super(160, 30, 375, 300)
- @rollbonus = false
- @roll_complete = false
- @multiroll_complete = false
- @adderroll_complete = false
- @bonusroll_complete = false
- @roll_values = []
- @multi_values = []
- @adder_values = []
- @bonus_values = []
- @multi_is_roll = $game_switches[NQ::MIRSWITCH]
- @adder_is_roll = $game_switches[NQ::AIRSWITCH]
- @bonus_is_roll = $game_switches[NQ::BIRSWITCH]
- @roll = $game_variables[NQ::VROLL]
- @multiplier = $game_variables[NQ::VMULT]
- @adder = $game_variables[NQ::VADDR]
- @roll_bonus = $game_variables[NQ::VRBNS]
- @total_roll = $game_variables[NQ::VTRLL]
- if @roll > 10 # if amount of dice to roll is greater than 10
- @roll = 10 # set to 10, max
- end
- if @roll == 0 #if amount of dice to roll is set to zero
- @roll = 1 #set to 1, minimum
- end
- x = 4 #create variable for x placement of still dice
- for i in 1..@roll #once for every die to be rolled
- draw_still_dice((NQ::DCOUNT.length*13) + x, 50)
- x += 26 #add 26 to x placement variable
- end
- if @multiplier > 10
- @multiplier = 10
- end
- if @multi_is_roll == true #if multiplier requires an additional roll
- x = 4 # x placement variable
- for i in 1..@multiplier #once for every die in the multiplier roll
- draw_still_dice((NQ::DMULTIPLIER.length*13) + x, 90)
- x += 26 # add 26 to x placement variable
- end
- end
- if @adder > 10
- @adder = 10
- end
- if @adder_is_roll == true
- x = 4
- for i in 1..@adder
- draw_still_dice((NQ::DADDER.length*13) + x, 130)
- x += 26
- end
- end
- if @roll_bonus > 10
- @roll_bonus = 10
- end
- if @bonus_is_roll == true
- x = 4
- for i in 1..@roll_bonus
- draw_still_dice((NQ::DROLLBONUS.length*13) + x, 170)
- x += 26
- end
- end
- refresh
- end
- #------------------------------------------------------------------------------
- # Start processing, fill contents at beginning of scene
- #------------------------------------------------------------------------------
- def refresh
- self.contents.font.color = text_color(NQ::DRINSTRUCT_COLOR)
- self.contents.draw_text(90, 4, self.width, WLH, NQ::DRINSTRUCT)
- draw_roll_text
- draw_multiplier_text
- draw_adder_text
- draw_bonusroll_text
- self.contents.font.color = system_color
- self.contents.draw_text(4, 210, self.width, WLH, NQ::DTOTAL)
- end
- #------------------------------------------------------------------------------
- # Determine Roll text color and draw
- #------------------------------------------------------------------------------
- def draw_roll_text
- if @roll_complete == true
- self.contents.font.color = text_color(20)
- self.contents.draw_text(4, 50, self.width, WLH, NQ::DCOUNT)
- else
- self.contents.font.color = system_color
- self.contents.draw_text(4, 50, self.width, WLH, NQ::DCOUNT)
- end
- end
- #-------------------------------------------------------------------------------
- # Determine Multiplier text color and draw
- #-------------------------------------------------------------------------------
- def draw_multiplier_text
- if @multiroll_complete == true #has the multiplier roll been complete
- self.contents.font.color = text_color(20) #change to active color
- self.contents.draw_text(4, 90, self.width, WLH, NQ::DMULTIPLIER)
- else
- self.contents.font.color = system_color #change to system color
- self.contents.draw_text(4, 90, self.width, WLH, NQ::DMULTIPLIER)
- end
- end
- #-----------------------------------------------------------------------------
- # Determine Adder text color and draw
- #-----------------------------------------------------------------------------
- def draw_adder_text
- if @adderroll_complete == true
- self.contents.font.color = text_color(20)
- self.contents.draw_text(4, 130, self.width, WLH, NQ::DADDER)
- else
- self.contents.font.color = system_color
- self.contents.draw_text(4, 130, self.width, WLH, NQ::DADDER)
- end
- end
- #-------------------------------------------------------------------------------
- # Determine Bonus Roll text color and draw
- #-------------------------------------------------------------------------------
- def draw_bonusroll_text
- if @bonusroll_complete == true
- self.contents.font.color = text_color(20)
- self.contents.draw_text(4, 170, self.width, WLH, NQ::DROLLBONUS)
- else
- self.contents.font.color = system_color
- self.contents.draw_text(4, 170, self.width, WLH, NQ::DROLLBONUS)
- end
- end
- #--------------------------------------------------------------------------------
- # Drawing the Dice after roll
- #--------------------------------------------------------------------------------
- def draw_the_dice(value, x, y)
- case value
- when 1
- draw_icon(NQ::DIE1, x, y)
- when 2
- draw_icon(NQ::DIE2, x, y)
- when 3
- draw_icon(NQ::DIE3, x, y)
- when 4
- draw_icon(NQ::DIE4, x, y)
- when 5
- draw_icon(NQ::DIE5, x, y)
- when 6
- draw_icon(NQ::DIE6, x, y)
- end
- end
- #--------------------------------------------------------------------------------
- # Drawing the Still Dice
- #--------------------------------------------------------------------------------
- def draw_still_dice(x, y)
- draw_icon(NQ::DIESTILL, x, y)
- end
- #--------------------------------------------------------------------------------
- # Rolling the initial roll
- #--------------------------------------------------------------------------------
- def roll_for_roll
- it = 0
- rt = 0
- @roll_values = [] # create the roll values array
- for i in 1..@roll # once for the number of dice in the roll
- Audio.se_play('Audio/SE/' + NQ::ROLLING_SE, 80, 100) #plays Rolling SE
- @roll_values.push(rand(5)+1) #adds a random number 1 through 6 to the array
- rt += @roll_values[it]
- it += 1
- end
- it = 0
- x = 4 #create an x placement variable
- for i in @roll_values #once for every item in the array
- value = @roll_values[it] #create a value for the current element of the array
- draw_the_dice(value, (NQ::DCOUNT.length*13) + x, 50) #call the draw dice method
- x += 26 #adds 26 to x variable for spacing
- it += 1
- end
- check_for_doubler(@roll, rt, @roll_values[0]) #passes number of dice, total of roll, first die roll
- @roll_complete = true
- Audio.se_play('Audio/SE/' + NQ::SET_DICE_SE, 80, 100)
- if @multi_is_roll == false #if multiplier does NOT require a roll
- @multiroll_complete = true #say the roll is complete
- if @adder_is_roll == false
- @adderroll_complete = true
- if @bonus_is_roll == false
- @bonusroll_complete = true
- tally_lines #if all conditions met, finish the roll
- end
- end
- end
- end
- #-------------------------------------------------------------------------------
- # Rolling for the multiplier
- #-------------------------------------------------------------------------------
- def roll_for_multiplier
- it = 0
- rt = 0
- @multi_values = []
- for i in 1..@multiplier
- Audio.se_play('Audio/SE/' + NQ::ROLLING_SE, 80, 100)
- @multi_values.push(rand(5)+1)
- rt += @multi_values[it]
- end
- it = 0
- x = 4
- for i in @multi_values
- value = @multi_values[it]
- draw_the_dice(value, (NQ::DMULTIPLIER.length*13) + x, 90)
- x += 26
- it += 1
- end
- check_for_doubler(@multiplier, rt, @multi_values[0])
- @multiroll_complete = true
- Audio.se_play('Audio/SE/' + NQ::SET_DICE_SE, 80, 100)
- if @adder_is_roll == false
- @adderroll_complete = true
- if @bonus_is_roll == false
- @bonusroll_complete = true
- tally_lines
- end
- end
- end
- #------------------------------------------------------------------------------
- # Rolling for Adder
- #-------------------------------------------------------------------------------
- def roll_for_adder
- it = 0
- rt = 0
- @adder_values = []
- for i in 1..@adder
- Audio.se_play('Audio/SE/' + NQ::ROLLING_SE, 80, 100)
- @adder_values.push(rand(5)+1)
- rt += @adder_values[it]
- it += 1
- end
- it = 0
- x = 4
- for v in @adder_values
- value = @adder_values[it]
- draw_the_dice(value, (NQ::DADDER.length*13) + x, 130)
- x += 26
- it += 1
- end
- check_for_doubler(@adder, rt, @adder_values[0])
- @adderroll_complete = true
- Audio.se_play('Audio/SE/' + NQ::SET_DICE_SE, 80, 100)
- if @bonus_is_roll == false
- @bonusroll_complete = true
- tally_lines
- end
- end
- #-------------------------------------------------------------------------------
- # Rolling for Bonus
- #------------------------------------------------------------------------------
- def roll_for_bonus
- it = 0
- rt = 0
- @bonus_values = []
- for i in 1..@roll_bonus
- Audio.se_play('Audio/SE/' + NQ::ROLLING_SE, 80, 100)
- @bonus_values.push(rand(5)+1)
- rt += @bonus_values[it]
- it += 1
- end
- it = 0
- x = 4
- for v in @bonus_values
- value = @bonus_values[it]
- draw_the_dice(value, (NQ::DROLLBONUS.length*13) + x, 170)
- x += 26
- it += 1
- end
- check_for_doubler(@roll_bonus, rt, @bonus_values[0])
- @bonusroll_complete = true
- Audio.se_play('Audio/SE/' + NQ::SET_DICE_SE, 80, 100)
- tally_lines
- end
- #-------------------------------------------------------------------------------
- # Tally the lines (find total)
- #-------------------------------------------------------------------------------
- def tally_lines
- @grand_total = 0 #create grand total
- ri = 0
- for i in @roll_values #add the values of roll
- @grand_total += @roll_values[ri]
- ri += 1
- end
- Audio.se_play('Audio/SE/' + NQ::TALLY_LINES_SE, 80, 100)
- if @multi_is_roll == true
- mi = 0
- mt = 0 #create total multiplier value
- for i in @multi_values #add the multiplier values
- mt += @multi_values[mi]
- mi += 1
- end
- @grand_total *= mt #multiply grand total by total multiplyer value
- Audio.se_play('Audio/SE/' + NQ::TALLY_LINES_SE, 80, 100)
- else
- @grand_total *= @multiplier #multiply grand total by multiplier instead
- Audio.se_play('Audio/SE/' + NQ::TALLY_LINES_SE, 80, 100)
- self.contents.font.color = normal_color
- self.contents.draw_text(180, 90, self.width, WLH, @multiplier) #draw the value of multiplier
- self.contents.font.color = system_color
- end
- if @adder_is_roll == true
- ai = 0
- for i in @adder_values #add the adder values
- @grand_total += @adder_values[ai]
- ai += 1
- end
- Audio.se_play('Audio/SE/' + NQ::TALLY_LINES_SE, 80, 100)
- else
- @grand_total += @adder #add adder to grand total instead
- Audio.se_play('Audio/SE/' + NQ::TALLY_LINES_SE, 80, 100)
- self.contents.font.color = normal_color
- self.contents.draw_text(180, 130, self.width, WLH, @adder)
- self.contents.font.color = system_color
- end
- if @bonus_is_roll == true
- bi = 0
- for i in @bonus_values #add the bonus values
- @grand_total += @bonus_values[bi]
- bi += 1
- end
- Audio.se_play('Audio/SE/' + NQ::TALLY_LINES_SE, 80, 100)
- else
- @grand_total += @roll_bonus
- Audio.se_play('Audio/SE/' + NQ::TALLY_LINES_SE, 80, 100)
- self.contents.font.color = normal_color
- self.contents.draw_text(180, 170, self.width, WLH, @roll_bonus)
- self.contents.font.color = system_color
- end
- self.contents.font.color = power_up_color
- self.contents.draw_text(180, 210, self.width, WLH, @grand_total)
- $game_variables[NQ::VTRLL] = @grand_total
- Audio.se_play('Audio/SE/' + NQ::TOTAL_GIVEN_SE, 80, 100)
- refresh
- end
- #------------------------------------------------------------------------------
- # Rolling the Dice
- #------------------------------------------------------------------------------
- def roll_the_dice
- if @bonusroll_complete == true
- tally_lines
- elsif @adderroll_complete == true
- roll_for_bonus
- elsif @multiroll_complete == true
- roll_for_adder
- elsif @roll_complete == true
- roll_for_multiplier
- elsif @roll_complete == false
- roll_for_roll
- end
- end
- #------------------------------------------------------------------------------
- # check for doubler bonus
- #------------------------------------------------------------------------------
- def check_for_doubler(dice, roll_total, first_value)
- bonus_check = NQ::MIN_DOUBLER
- use_doub = NQ::USE_DOUBLER
- if use_doub == true # if bonus doubler is being used
- if dice >= bonus_check #if number of dice to be rolled is greater than
- # minimum required
- @rollbonus = true #turn flag on to compare values of dice
- else
- @rollbonus = false
- end
- end
- if @rollbonus == true
- d = dice #number of dice rolled
- rt = roll_total #total of the given roll
- fv = first_value #value of first die in roll
- fv *= d #multiply first die by roll_total
- if fv == rt #if first value now equals roll_total
- Audio.se_play('AUDIO/SE/' + NQ::DOUBLER_SE, 100, 85)
- @total_roll *= 2
- $game_variables[NQ::VTRLL] = @total_roll
- self.contents.font.color = text_color(19)
- self.contents.draw_text(4, 290, self.width, WLH, NQ::DBONUS)
- end
- end
- end #end of method
- end #end of class
- ##################################################################################
- class Window_D6 < Window_Base
- attr_accessor :vstat
- attr_accessor :vstswitch
- def initialize
- super(4, 30, 155, 140)
- @vstat = $game_variables[NQ::VSTAT]
- @vstswitch = $game_switches[NQ::VSTATSWITCH]
- refresh
- end
- def refresh
- self.contents.font.color = power_up_color
- self.contents.draw_text(3, 3, self.width, WLH, $game_variables[NQ::VROLL].to_s + "D6")
- self.contents.font.color = system_color
- case $game_variables[NQ::VRTYP]
- ##################################################################################
- # CONFIG2
- #
- # If you made any changes in the CONFIG1, by adding or
- # or subtracting roll types, you need to make this one match. The set up is
- # simple, if you've deleted a roll type, you'll just delete the section
- #
- # when x
- # self.contents.draw_text(...
- #
- # for the one you deleted, and if you added one, just follow the
- # same method and create the new ones below those listed here.
- #
- # when x
- # self.contents.draw_text(x, y, width, height, string)
- #
- # This will create a new possible string to display, based on what you pass into
- # the scene through in game variable found in VRTYP.
- #################################################################################
- when 0
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_1)
- when 1
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_2)
- when 2
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_3)
- when 3
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_4)
- when 4
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_5)
- when 5
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_6)
- when 6
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_7)
- when 7
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_8)
- when 8
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_9)
- when 9
- self.contents.draw_text(5, 40, self.width, WLH, NQ::RTYPE_10)
- ###################################################################################
- # END CONFIG2
- ##################################################################################
- end
- if @vstswitch == true
- self.contents.draw_text(20, 70, self.width, WLH, "(" + @vstat.to_s + ")")
- end
- end
- end
- ###################################################################################
- class Scene_Dice < Scene_Base
- def initialize
- create_menu_background
- @dice_window = Window_Dice.new
- @window_d6 = Window_D6.new
- end
- def update
- super
- update_menu_background
- @dice_window.refresh
- @window_d6.refresh
- if $game_variables[NQ::VTRLL] == 0
- if Input.trigger?(NQ::INPUT_TO_ROLL)
- @dice_window.roll_the_dice
- end
- elsif $game_variables[NQ::VTRLL] > 0
- if Input.trigger?(NQ::INPUT_TO_ROLL)
- Sound.play_decision
- exit_the_scene
- end
- end
- end
- def exit_the_scene
- $game_switches[NQ::VSTATSWITCH] = false
- $game_switches[NQ::MIRSWITCH] = false
- $game_switches[NQ::AIRSWITCH] = false
- $game_switches[NQ::BIRSWITCH] = false
- $game_variables[NQ::VTRLL] = 0
- $scene = Scene_Map.new
- end
- def terminate
- @dice_window.dispose
- @window_d6.dispose
- dispose_menu_background
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment