注册会员 登录
Project1 返回首页

鼠窝 https://rpg.blue/?335626 [收藏] [复制] [分享] [RSS] ~外站脚本图书馆~

日志

类似于口袋妖怪的会心一击

已有 350 次阅读2014-5-17 13:43 |个人分类:外站脚本| 口袋妖怪

###############################################################################
#
#   Critical Hits - Pokémon Style!
#
# Made by Xabring
# A simple Script that changes the critical hit formula to be
# suspiciously similar to the way you make crits in Pokémon.
# (Like in Gen I to V, by default, but you can change that.)
# you must be familiar with how pokemon handles critical hits
# (in Gen II and adove) to understand this script with no problems.
# if you don't, I'll try to explain myself as best as I can.
# or you can access this website
# http://bulbapedia.bulbagarden.net/wiki/Critical_hit_ratio#Generation_VI
# to understand how the hell critical hits works on pokemon
#
# Sorry if my spanglish is awfull, but it's not exactly my default language.
#
#
###############################################################################
#
# Customizable Variables: 2
#            
#                 -Critical Hit Multiplier
#                 -Critical Stages (It's a 5-in-1 variable :P)
#
# Compatibility:
#
#   Full compatible with anything that doesn't mess with the battle calculations
#   too heavily, I have tested in some Jet scripts, and even one from
#   SoulPoor777 who does add sfx sound to criticals, and it works with them.
#   any incompatibility, please report it in this thread and I'll see if my
#   laptop doesn't catch fire trying to debug this.
#
# Tools for coders:
#
#   Simply turn on the console and watch how your critical lands, the chance
#   to do so, and if they actually connect.
#
#
###############################################################################
#
#   How the heck to use this script:
#
# 1.- Need something inmune to critical hits? just set that
#     actor/class/enemy CEV parameter to 100%, and not even <headshot>
#     will hit them critical, is that simple. You can do this via many
#     ways, adding the CEV in a status, or in the class character, etc.
#
# 2.- All skills of a particular enemy or actor has a MINIMUN
#     base chance defined at CRIT_STAGE[0]
#     however, every 20% Crit parameter that you add to a char via
#     many ways as in, states, class, AND this very script, etc. is
#     1 stage adobe the default one 
#
#     20%~40% total CRI = CRIT_STAGE[1]
#     40%~60% total CRI = CRIT_STAGE[2] and so on.
#
#     (You can, add an item that is called 'Lucky Punch', only equipped to
#     an actor called 'Chansey' and give the effect '+40% CRI' and it will
#     do the same thing that in pokemon, give'em a critical edge!)    
#
# 3.- no, 100% Crit doesn't mean always crit unless you put
#     CRIT_STAGE[4] = 1
#     in other words, 100% or more CRI means it's at maximun stage instead
#     of 100% acurracy unless you specify that otherwise, of course.
#     (I know, I was redundant, but still....)
#
# 4.- If you need a particular skill to have increased chance to
#     land a critical hit(ex. Karate Chop)...
#     add the <high critical chance> tag to the skill's note box
#     but for a skill that ALWAYS land a critical hit, (ex. Frost Breath)
#     add the tag <headshot> at the note box. Again, if the target's CEV
#     is 100% or more, it doesn't work, so keep that in mind.
#
#
#
###############################################################################
#
# Customize Here!
#
#
module Xabring
  module Crit_PokeStyle
   
    # Change how hard you'll hit with a critical hit
    # Note for newbies; 1 is equivalent to 100%, so here,
    # 2 is the equivalent of 200%, 2.5 = 250% and so on...
    # how do I know? because of a witchery called Math...
    CRITICAL_MULTIPLIER = 2
    # this will be implemented soon, in pokemon, anyone with
    # the sniper hability has to do 1.5 even more damage than usual
    # if it lands a critical hit. I'll leave this bonus here just
    # in case somebody messes with the code and add support for this
    # bonus, somehow, or when I update this thing, whichever happens first.
   
    # CRITICAL_BONUS = 1.5
    # Commented to prevent to chomp on your memory in vain.
   
    # Stages of chance of critical, in ascendent order of chance.
    # Just like multiplier, 1 = 100%, so 0.0625 = 6.25%, 0.125 = 12.5%
    # and so on...   
   
    #This is for preventing your PC From exploding, so don't touch
    CRIT_STAGE = [] #DON'T TOUCH, seriously!
   
    #AAND the ones you can customize
    CRIT_STAGE[0] = 0.0625  #This is your default chance to land a crit.
    CRIT_STAGE[1] = 0.125
    CRIT_STAGE[2] = 0.25
    CRIT_STAGE[3] = 0.333
    CRIT_STAGE[4] = 0.5     #This is your maximun chance without <headshot>
   
   
  end
end
#
#
#Stop Customizing here...it's done
###############################################################################
# Here's the actual code. Don't touch unless you are a programmer, don't care
# or both, Just like me :P . You probably can learn to code yourself
# if you pay enough attention, unlike me XD
###############################################################################
class Game_Battler
  alias poke_crit item_cri
  def item_cri(user, item)
    poke_stage = 0
    will_crit = false
    if cev < 1     
      printf("Used %s on %s\n",item.name,name)
      poke_stage = user.cri*5
      if item.note.include? "<high critical chance>"
        printf("the move has higher critical chance than usual\n")
        poke_stage+=1
      end
      printf("Stage to Crit: %d\n",poke_stage)        
      if item.note.include? "<headshot>"
        will_crit = true
      end
      if item.damage.critical
        if !will_crit
          if poke_stage < 5           
            printf("Chance of Critical: %10.2f percent \n",Xabring::Crit_PokeStyle::CRIT_STAGE[poke_stage]*100)
            Xabring::Crit_PokeStyle::CRIT_STAGE[poke_stage]         
          else
            printf("Chance of Critical: %10.2f percent \n",Xabring::Crit_PokeStyle::CRIT_STAGE[4]*100)
            Xabring::Crit_PokeStyle::CRIT_STAGE[4]
          end         
        else
          printf("Skill will land a Critical Hit\n")
          1
        end       
      else
        printf("Skill is unable to critical\n")
        0
      end
    else
      printf("too evasive to hit critical\n")
      0
    end   
  end
 
  alias poke_crit_ratio apply_critical
  def apply_critical(damage)
    printf("In the weak spot!!!\n")
    damage * Xabring::Crit_PokeStyle::CRITICAL_MULTIPLIER
   
  end
 
end

鸡蛋

鲜花

评论 (0 个评论)

facelist doodle 涂鸦笔

您需要登录后才可以评论 登录 | 注册会员

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-27 23:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

返回顶部