查看: 4280|回复: 25

[已经解决] 数值的问题

[复制链接]
梦石
0
星屑
2245
在线时间
1015 小时
注册时间
2015-10-17
回帖
1077
发表于 2017-12-20 18:52:43 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
例如实际金钱是100,但游戏菜单里显示101,问下这个怎么做呢
梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-12-20 19:00:21 | 显示全部楼层
本帖最后由 soulsaga 于 2017-12-20 19:05 编辑

大佬要防修改党了..666
不过如果只是改显示的话..玩家可能会发现不够钱买不了东西..

点评

fjm
存档修改可以预防了,现在数值修改不能防,老有人发作弊的图发群里,感觉很烦,所以想搞下  发表于 2017-12-20 19:54
fjm
能防菜鸟修改就可以了,大佬都不用修改数值,直接修改工程的  发表于 2017-12-20 19:50
而且这样是防不到大佬修改的..  发表于 2017-12-20 19:15
fjm
多1到2  发表于 2017-12-20 19:11
fjm
没事都1到2块没影响  发表于 2017-12-20 19:10
回复

使用道具 举报

梦石
0
星屑
34460
在线时间
5096 小时
注册时间
2012-11-19
回帖
4715

开拓者

发表于 2017-12-20 19:30:34 | 显示全部楼层
把金钱数值用字符串形式加密。
这能增加其破解的难度。

点评

fjm
感谢芯大,我试试  发表于 2017-12-20 19:51
xp vx va mv  va mz 各类型脚本/插件定制
回复

使用道具 举报

梦石
0
星屑
6375
在线时间
1473 小时
注册时间
2015-7-25
回帖
609

极短25参与开拓者

发表于 2017-12-20 19:59:20 | 显示全部楼层
[pre lang="ruby"]class Window_Gold
  def value
    $game_party.gold + 1
  end
end
class Scene_Shop
  def money
    $game_party.gold
  end
end[/pre]

........这样是不是有点奇怪2333

点评

fjm
那像人物伤害,武器,防御之类都可以这样搞了  发表于 2017-12-20 20:16
fjm
感谢肉包,问题解决了  发表于 2017-12-20 20:13
笨肉包的游戏讨论群932812135 (实时更新) 喜欢的话欢迎加入~
目前的坑
??? #像素风OC游戏 准备中 短篇-约5小时
花城梦之心 #像素风OC游戏 系统开发+素材绘制中
【不可思议的迷宫】幽灵契约外传:歌莉娅 v0.4 游戏文件已更新
同时更新中~ (沉迷摸鱼中~更新速度较慢请见谅w)
这是属于笨肉包一个人的旅行~(这只肉包又在摸鱼!
旅途的最终目标~ ???(保密~
回复

使用道具 举报

梦石
0
星屑
2245
在线时间
1015 小时
注册时间
2015-10-17
回帖
1077
 楼主| 发表于 2017-12-20 20:45:51 | 显示全部楼层
本帖最后由 fjm 于 2017-12-20 20:59 编辑
魔法丶小肉包 发表于 2017-12-20 19:59
class Window_Gold
  def value
    $game_party.gold + 1


还有武器防具上的数值也想+1,找了很久也没找到在哪里
人物状态数值例如最大HP+1,好像也处理的不对,看下哪里出错了,谢谢
物品数量也没成功

class Window_ItemList
  def value
    $game_party.last_item + 1
  end
end

class Window_Status
  def value
    $game_actors.mhp + 1
    $game_actors.act + 1
  end
end

class Window_Actor
  def value
    $game_actors.mhp + 1
     $game_actors.param(0) + 1
  end
end

class Window_Status
  def value
    $Game_BattlerBase.mhp + 1
  end
end

class Window_EquipStatus
  def value
    $
  end
end

点评

角色hp的话呢脚本搜一下绘制 HP那里draw_current_and_max_values(x, y, width, actor.hp+1, actor.mhp+1, hp_color(actor), normal_color)  发表于 2017-12-20 21:47
脚本搜一下绘制物品个数那里draw_text(rect, sprintf(":%2d", $game_party.item_number(item)+1), 2)  发表于 2017-12-20 21:31
fjm
那请教下,道具数量,和武器装备数值窗口显示也+1,该怎么写呢  发表于 2017-12-20 21:24
.....Window_Gold里写value是因为默认脚本中这个类里有名为value的方法...并不是说每个类里都这么写...  发表于 2017-12-20 21:21
回复

使用道具 举报

梦石
0
星屑
2245
在线时间
1015 小时
注册时间
2015-10-17
回帖
1077
 楼主| 发表于 2017-12-20 21:47:47 | 显示全部楼层
fjm 发表于 2017-12-20 20:45
还有武器防具上的数值也想+1,找了很久也没找到在哪里
人物状态数值例如最大HP+1,好像也处理的不对,看 ...

非常感谢,武器装备显示数值那+1

  def draw_new_param(x, y, param_id)
    new_value = @temp_actor.param(param_id)
    change_color(param_change_color(new_value - @actor.param(param_id))+1)
    draw_text(x, y, 32, line_height, new_value, 2)
  end
end

我搞成这样又报错了,麻烦再帮忙看下

点评

上面这行+1也一样嗯  发表于 2017-12-20 21:58
change_color那行是改字体颜色的...下面那行才是绘制能力值的,draw_text(x, y, 32, line_height, new_value+1, 2)  发表于 2017-12-20 21:57
fjm
感谢肉包,帮忙解决了这么多问题  发表于 2017-12-20 21:51
fjm
new_value = @temp_actor.param(param_id)+1,是上面这一行+1  发表于 2017-12-20 21:51
回复

使用道具 举报

梦石
0
星屑
2245
在线时间
1015 小时
注册时间
2015-10-17
回帖
1077
 楼主| 发表于 2017-12-20 22:17:54 | 显示全部楼层
本帖最后由 fjm 于 2017-12-20 22:19 编辑
fjm 发表于 2017-12-20 21:47
非常感谢,武器装备显示数值那+1

  def draw_new_param(x, y, param_id)


感谢肉包,还有个问题就是用了下面那个脚本,加的属性是16,武器具体状态显示还是15,能让武器显示栏里的数值也变16吗
这个问题能解决吗

[pre lang="ruby"]#encoding:utf-8
#==============================================================================
# ■ 装备说明增强 By wyongcan
#==============================================================================
module Equipplus
  CODE ={
    11 => "属性抗性",
    12 => "弱化抗性",
    13 => "状态抗性",
    14 => "状态免疫",
    21 => "普通能力",
    22 => "添加能力",
    23 => "特殊能力",
    31 => "攻击附带属性",
    32 => "攻击附带状态",
    33 => "修正攻击速度",
    34 => "添加攻击次数",
    41 => "添加技能类型",
    42 => "禁用技能类型",
    43 => "添加技能",
    44 => "禁用技能",
    51 => "可装备武器类型",
    52 => "可装备护甲类型",
    53 => "固定装备",
    54 => "禁用装备",
    55 => "装备风格",
    61 => "添加行动次数",
    62 => "特殊标志",
    63 => "消失效果",
    64 => "队伍能力"}
  #特殊标志
  FLAG ={
                0 => "自动战斗",
                1 => "擅长防御",
                2 => "保护弱者",
                3 => "特技专注"}
  #普通能力
        PARAM ={
                0 => "最大HP",
                1 => "最大MP",
                2 => "物理攻击",
                3 => "物理防御",
                4 => "魔法攻击",
                5 => "魔法防御",
                6 => "敏 捷 值",
                7 => "幸 运 值"}
  #添加能力
        XPARAM ={
                0 => "物理命中几率:",
                1 => "物理闪避几率:",
                2 => "必杀几率:",
                3 => "必杀闪避几率:",
                4 => "魔法闪避几率:",
                5 => "魔法反射几率:",
                6 => "物理反击几率:",
                7 => "体力值再生速度:",
                8 => "魔力值再生速度:",
                9 => "特技值再生速度:"}
  #特殊能力
        SPARAM ={
                0 => "受到攻击的几率",
                1 => "防御效果比率",
                2 => "恢复效果比率",
                3 => "药理知识",
                4 => "MP消费率",
                5 => "TP消耗率",
                6 => "物理伤害加成",
                7 => "魔法伤害加成",
                8 => "地形伤害加成",
                9 => "经验获得加成"}
        @队伍能力 ={
                0 => "遇敌几率减半",
                1 => "随机遇敌无效",
                2 => "敌人偷袭无效",
                3 => "先制攻击几率上升",
                4 => "获得金钱数量双倍",
                5 => "物品掉落几率双倍"}
  def self.equiphelpready
    @状态 = {}
    @武器类型 = {}
    @防具类型 = {}
    @属性 = {}
    $data_states.each{|x| @状态[x.id] = x.name if x != nil}
    elements = $data_system.elements
    weapon_types = $data_system.weapon_types
    armor_types = $data_system.armor_types
    elements.each_with_index{|x,y| @属性[y] = x if x != ""}
    weapon_types.each_with_index{|x,y| @武器类型[y] = x if x != ""}
    armor_types.each_with_index{|x,y| @防具类型[y] = x if x != ""}
  end
  def self.getequiphelp(equip)
    help = ""
    param = []
    equip.params.each_with_index{|x,y| param.push([PARAM[y],x])}
    param = param.select{|x| x[1] != 0}
    param.each{|x| help += x[0] + ":" + x[1].to_int.to_s + "\n"}
    features = equip.features
    features.select{|x| x.code == 55}.each{|x| help += CODE[x.code] + ":双持武器" + "\n"}
    features.select{|x| x.code == 11}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "*" + x.value.to_s + "\n"}
    features.select{|x| x.code == 12}.each{|x| help += CODE[x.code] + ":" + PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
    features.select{|x| x.code == 13}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "*" + x.value.to_s + "\n"}
    features.select{|x| x.code == 14}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "\n"}
    features.select{|x| x.code == 31}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "\n"}
    features.select{|x| x.code == 32}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "+" + x.value.to_s + "\n"}
    features.select{|x| x.code == 33}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
    features.select{|x| x.code == 34}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
    features.select{|x| x.code == 41}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
    features.select{|x| x.code == 42}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
    features.select{|x| x.code == 43}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
    features.select{|x| x.code == 44}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
    features.select{|x| x.code == 51}.each{|x| help += CODE[x.code] + ":" + @武器类型[x.data_id]  + "\n"}
    features.select{|x| x.code == 52}.each{|x| help += CODE[x.code] + ":" + @防具类型[x.data_id]  + "\n"}
    features.select{|x| x.code == 61}.each{|x| help += CODE[x.code] + ":" + x.value.to_s  + "\n"}
    features.select{|x| x.code == 62}.each{|x| help += CODE[x.code] + ":" + FLAG[x.data_id]  + "\n"}
    features.select{|x| x.code == 64}.each{|x| help += CODE[x.code] + ":" + @队伍能力[x.data_id]  + "\n"}
    featuresparam = []
    featuresparam.push features.select{|x| x.code == 21}
    featuresparam.push features.select{|x| x.code == 22}
    featuresparam.push features.select{|x| x.code == 23}
    featuresparam[0].each{|x| help += PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
    featuresparam[1].each{|x| help += XPARAM[x.data_id] + x.value.to_s + "\n"}
    featuresparam[2].each{|x| help += SPARAM[x.data_id] + "*" + x.value.to_s + "\n"}
    help
  end
  def self.getline(text,maxtext)
    xtext = []
    line = 0
    text.each_line{|x| xtext.push x.sub(/\n/){}}
    xtext.each{|x| x.size % maxtext != 0 ? line += x.size / maxtext + 1 : line += x.size / maxtext}
    line
  end
end
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  显示特技和物品等的说明、以及角色状态的窗口
#==============================================================================

class Window_Help2 < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(line_number = 0)
    super(0, 0, 210, 0)
    self.z = 150
    contents.font.size = 14
    hide
  end
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
      @text = text
      refresh
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 更新帮助位置
  #--------------------------------------------------------------------------
  def uppos(index,rect,window)
    self.height = fitting_height2(Equipplus.getline(@xtext,13))
    create_contents
    contents.font.size = 14
    rect.x -= window.ox
    rect.y -= window.oy
    ax = rect.x + rect.width + 20
    ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
    ax += window.x
    ax = 0 if ax < 0
    ay = rect.y + rect.height+ 20
    ay = rect.y - self.height if ay + self.height > window.height
    ay += window.y
    ay = 0 if ay < 0
    self.x = ax
    self.y = ay
    set_text(@xtext)
    show
  end
  #--------------------------------------------------------------------------
  # ● 设置物品
  #     item : 技能、物品等
  #--------------------------------------------------------------------------
  def set_item(item)
    if item == nil
      set_text("")
      return
    end
    @xtext = ""
    @xtext = "名称:" + item.name + "\n"
    @xtext += "介绍:" + item.description + "\n"
    @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
    @xtext += Equipplus.getequiphelp(item) if item.is_a?(RPG::EquipItem)
    @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    hide if @text == ""
    draw_text_ex(4, 0, @text,width,40,false)
  end
end
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● 计算窗口显示指定行数时的应用高度2*************************
  #--------------------------------------------------------------------------
  def fitting_height2(line_number)
    line_number * contents.font.size + standard_padding * 2
  end
#~ draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  #--------------------------------------------------------------------------
  # ● 绘制带有控制符的文本内容
  #   如果传递了width参数的话,会自动换行
  #--------------------------------------------------------------------------
  def draw_text_ex(x, y, text, width = nil,textwidth = nil,normalfont = true)
    reset_font_settings if normalfont == true
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    if width != nil
      pos[:height] = contents.font.size
      pos[:width] = width
      pos[:textwidth] = textwidth
    end
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end
  #--------------------------------------------------------------------------
  # ● 文字的处理
  #     c    : 文字
  #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  #--------------------------------------------------------------------------
  def process_character(c, text, pos)
    case c
    when "\r"   # 回车
      return
    when "\n"   # 换行
      process_new_line(text, pos)
    when "\f"   # 翻页
      process_new_page(text, pos)
    when "\e"   # 控制符
      process_escape_character(obtain_escape_code(text), text, pos)
    else        # 普通文字
      pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
      if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
        process_new_line(text, pos)
      end
      process_normal_character(c, pos)
    end
  end
end

class Window_ItemList < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item)
    @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  end
end

class Window_SkillList < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item)
    @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  end
end

class Window_ShopBuy < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item) if @help_window
    @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
    @status_window.item = item if @status_window
  end
end

class Window_EquipSlot < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    super
    @help_window.set_item(item) if @help_window
    @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
    @status_window.set_temp_actor(nil) if @status_window
  end
end

class Scene_Shop < Scene_MenuBase
        alias on_sell_ok_old on_sell_ok
        def on_sell_ok
                on_sell_ok_old
                @help_window.hide
        end
        alias on_buy_ok_old on_buy_ok
        def on_buy_ok
                on_buy_ok_old
                @help_window.hide
        end
        alias on_number_ok_old on_number_ok
        def on_number_ok
                on_number_ok_old
    @help_window.refresh
                @help_window.show
        end
        alias on_number_cancel_old on_number_cancel
        def on_number_cancel
                on_number_cancel_old
    @help_window.refresh
                @help_window.show
        end
end

class Scene_Title < Scene_Base
  alias start_old start
  def start
    start_old
    Equipplus.equiphelpready
  end
end

class Scene_ItemBase < Scene_MenuBase
        alias old_on_actor_cancel on_actor_cancel
  def on_actor_cancel
    old_on_actor_cancel
        @help_window.refresh
  end
        alias old_on_actor_ok on_actor_ok
  def on_actor_ok
    old_on_actor_ok
        @help_window.refresh
  end
end

class Window_Base < Window
        alias old_process_new_line process_new_line
        def process_new_line(text, pos)
    old_process_new_line(text, pos)
                pos[:height] = contents.font.size if pos[:width] != nil
        end
end

class Scene_MenuBase < Scene_Base
  def create_help_window
    @help_window = Window_Help2.new
    @help_window.viewport = @viewport
  end
end
class Scene_Battle < Scene_Base
  def create_help_window
    @help_window = Window_Help2.new
    @help_window.visible = false
  end
end[/pre]
QQ截图20171220221428.jpg

点评

fjm
太感谢肉包了,完美解决了  发表于 2017-12-20 22:46
第96行改成param.each{|x| help += x[0] + ":" + (x[1]+1).to_int.to_s + "\n"}  发表于 2017-12-20 22:39
回复

使用道具 举报

梦石
0
星屑
1446
在线时间
6552 小时
注册时间
2010-12-30
回帖
8655
发表于 2017-12-21 00:15:43 | 显示全部楼层
玩家看看菜单,又看看实际运行的体现,就会觉的自己是不是在哪被-1S了

评分

参与人数 1赞 +1 收起 理由
赤炎 + 1

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部