03-07-2008, 06:00 AM
Disallow No Weapon
By Jirbytaylor
Version: 1.0
By Jirbytaylor
Version: 1.0
Introduction
Most of us are aware how having no weapon will mean physical attacks will deal zero damage. Usually this is fine, as there are scripts to allow punches, and other similar moves.
However consider this - Aluxes has no weapon, yet can still use Cross Cut. Illogical!
This edit remedies that paradox by preventing no weapon from being equipped in the default equipment system.
Features
- When a weapon is equipped, you can no longer have no weapon equipped.
- Plays buzzer when trying to unequip something
Code:
# Disallow No Weapon~ By Jirbytaylor
class Scene_Equip
def update_item
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Activate right window
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the item window
item = @item_window.item
# Change equipment, check if weapon selected
if @right_window.index == 0
if item == nil
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.equip_se)
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
end
else
$game_system.se_play($data_system.equip_se)
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
end
# Activate right window
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# Remake right window and item window contents
@right_window.refresh
@item_window.refresh
return
end
end
end
Place this script below SDK and above Main.
FAQ
Awaiting questions~
Compatibility
0.1% chance this works with MultiSlot systems or Weapon Customisations. (Or anything that edits update_item in Scene_Equip.)
Compatible with SDK 1, 2.2 and without. (Last time I checked SDK did not edit update_item)
Terms and Conditions
May be used in free or commercial games, not like any commercial games will be using the default equipment system anyway~
Credit should go to myself.
This is a simple edit, but I'm sure people will find it useful if they have classes that learn weapon-like skills.