青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當自強而不息

Controlling Players and Characters(27)

 

Spells in Combat

Now, you can put all the neat spells that your game has to offer to good use. You
know how spells work, but you need to know how the spells affect the characters.
Remember that the spell controller tracks only the meshes that create the visual
side of spells; the character controller determines the effects of the spells.

Spells in combat are used mainly to damage an opponent. A spell uses a series of
calculations to determine the outcome of the spell’s effects, just as physical attacks
do. Spells have a chance of failing, which is determined by the spell’s chance value
in the spell definition.

The chance of a spell working is increased by the caster’s mental ability, which uses
the following calculation to determine the multiplier to apply to the chance value:

// Chance = spell’s chance of working
// Mental = caster’s mental ability
Chance = (long)(((float)Mental / 100.0f + 1.0f) * (float)Chance);

The last line shows that the mental value can range from 0 and up. A value of 150
means to increase the chance by 50 percent, whereas a value of 200 means to double
the chances. To aid victims of a spell, the target characters have their associated
resistance abilities factored in as well:

// Resistance = target’s resistance ability
Chance = (long)((1.0f - (float)GetResistance(Target) / 100.0f) * (float)Chance);

When it is determined that the spell took effect, the appropriate actions can be
taken to handle the results. The only spell effect you want to contend with at this
time is damage. Whenever damage is dealt to a victim, the victim’s resistance ability
is used to reduce the amount of damage. Resistance is a percentage value, which
means that a value of 0 does not reduce spell damage, whereas a value of 100 completely
dispels damage.

Status ailments also work their way into spell casting. An ailment of Silenced means a
character can’t even cast magic spells, whereas an ailment of Dumbfounded reduces
a character’s mental ability by half. Finally, the Enchanted and Barrier ailments
reduce the victim’s resistance by half or increase the resistance by 50 percent, respectively.

You can use the following code to determine whether a spell affects the victim and
just how much damage is dealt:

// Chance = Magic spell’s chance of working
// Mental = Spell caster’s mental ability
// Resistance = victim character’s resistance amount
// Amount = base damage amount spell causes
// Apply status ailments to mental and resistance

if(Ailments & AILMENT_DUMBFOUNDED)
  Mental /= 2;

if(Ailments & AILMENT_ENCHANTED)
  Resistance = (long)((float)Resistance * 0.5f);

if(Ailments & AILMENT_BARRIER)
  Resistance = (long)((float)Resistance * 1.5f);

// Check chance of working and calculate damage
Chance=(long)(((float)Mental / 100.0f + 1.0f) * (float)Chance);

if((rand() % 100) < Chance) {
  float Resist = 1.0f - ((float)Resistance / 100.0f);
  long DmgAmount = (long)((float)Amount * Resist);

  // Apply extra class damage or cure-class amounts here
}

After a spell has hit its target, the proper amount of damage to apply is calculated.
Remember that certain classes of spells can cause twice as much damage as the spell
normally would to a character, whereas other spells can cure half the damage dealt.
 

Intelligence in Combat

Although your game’s players are completely capable of controlling their player
characters, it’s up to you to control the NPCs. In order to make your game worthy,
the NPCs’ artificial intelligence needs to be up to par for combating. Their actions
need to mimic yours, from choosing to attack, healing themselves, or casting a spell.

Characters are given a rudimentary intelligence when it comes to combat. If a character
has lost over half of his health or is under the effects of a status ailment, that
character will attempt to heal himself or dispel the ailments. This means it will
search through its list of known spells (if any) and cast the appropriate spell for aid.

If, on the other hand, a PC comes into another character’s range, a hostile charac-
ter then chooses to either perform a physical attack or a magical attack (if any
spells are known). You need to assign the chances that a character will perform
either type of attack. Note that attacks are based on the built-up charge of the
attacking creature—the charge must be full in order for the creature to attack.

When the decision is made to attack a nearby character, either the attack is performed
or a magic spell is chosen. Only spells that hurt other characters are cast. If a character
does not have a viable target character in range, the game randomly decides that
the character in question will attempt to enhance itself by using a status ailment-causing
spell, in this way raising its strength, agility, or other beneficial ailment.

The specifics on performing the preceding actions come into play when you create
a character controller that will make such decisions for your characters.

posted on 2007-12-03 21:00 lovedday 閱讀(155) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久久久久久久久久成人| 久久免费的精品国产v∧| 亚洲女性喷水在线观看一区| 国内精品久久久久伊人av| 欧美一区二区在线视频| 蜜桃伊人久久| 性色一区二区三区| 欧美成人一区二区三区片免费| 日韩午夜免费| 欧美在现视频| 亚洲一区激情| 欧美成人黑人xx视频免费观看| 亚洲影院一区| 欧美电影资源| 久久精品国产免费观看| 久久久久免费| 欧美一区二区视频在线观看2020 | 亚洲天堂av图片| 亚洲二区在线视频| 新狼窝色av性久久久久久| 一区二区三区四区在线| 久久深夜福利| 久久久97精品| 欧美午夜精品久久久久久超碰| 久久高清国产| 国产精品大片| 亚洲日本激情| 亚洲第一免费播放区| 午夜影院日韩| 亚洲欧美日韩另类精品一区二区三区 | 亚洲一级在线观看| 欧美激情精品久久久久久大尺度 | 中文一区字幕| 欧美jjzz| 亚洲电影专区| 极品裸体白嫩激情啪啪国产精品| 99国产精品视频免费观看| 亚洲另类春色国产| 久久久青草青青国产亚洲免观| 久久国产精品毛片| 国产精品久久久久国产a级| 亚洲精品乱码久久久久久| 亚洲精品网站在线播放gif| 久久综合色88| 亚洲成色777777女色窝| 亚洲大片在线| 久久综合导航| 亚洲国产成人精品女人久久久 | 亚洲成人在线免费| 久久日韩粉嫩一区二区三区| 理论片一区二区在线| 国际精品欧美精品| 久久久久成人精品| 欧美成人高清| 亚洲精品久久久久久久久| 欧美黄色精品| 亚洲国产91色在线| 一本不卡影院| 欧美成人精品三级在线观看| 亚洲欧洲日本国产| 亚洲午夜羞羞片| 国产麻豆视频精品| 久久激情网站| 亚洲激情视频网站| 日韩午夜激情| 国产精品日韩精品欧美在线| 性欧美暴力猛交69hd| 欧美有码在线观看视频| 激情av一区二区| 欧美激情在线| 一本色道久久| 久久久国产91| 99亚洲视频| 在线观看成人小视频| 国产精品老牛| 欧美激情在线| 久久永久免费| 午夜视频精品| 99精品国产在热久久婷婷| 免费久久99精品国产自在现线| 亚洲一区一卡| 一本色道久久88综合亚洲精品ⅰ| 精品成人a区在线观看| 国产精品jvid在线观看蜜臀 | 国产精品区一区二区三| 免费黄网站欧美| 欧美一区视频在线| 一本不卡影院| 亚洲日本激情| 亚洲国产免费看| 久久综合影视| 久久人人爽人人爽| 欧美制服丝袜第一页| 亚洲专区一区二区三区| 一本色道久久综合亚洲精品高清| 亚洲国产电影| 亚洲欧美日本伦理| 亚洲九九九在线观看| 亚洲丰满在线| 亚洲国产经典视频| 欧美电影免费网站| 欧美成人a视频| 欧美成人国产一区二区| 麻豆精品精华液| 免费精品99久久国产综合精品| 久久久久久9| 久久婷婷麻豆| 每日更新成人在线视频| 免费在线观看精品| 欧美成年视频| 亚洲欧洲日本一区二区三区| 亚洲国产欧美一区二区三区丁香婷| 蜜臀av性久久久久蜜臀aⅴ四虎| 久久婷婷综合激情| 免费欧美在线| 亚洲第一精品电影| 亚洲人成网站精品片在线观看 | 日韩系列在线| 在线中文字幕一区| 亚洲一区二区在线视频 | 欧美成人午夜| 欧美母乳在线| 国产精品成人久久久久| 国产日韩欧美精品一区| 激情国产一区| 最新国产精品拍自在线播放| 亚洲精品久久久久| 亚洲午夜一区二区| 久久精品国内一区二区三区| 裸体丰满少妇做受久久99精品| 麻豆freexxxx性91精品| 亚洲电影免费观看高清| 9久草视频在线视频精品| 亚洲视频在线观看| 欧美在线视频播放| 你懂的视频欧美| 国产精品红桃| 尤妮丝一区二区裸体视频| 亚洲精品乱码久久久久久黑人| 亚洲线精品一区二区三区八戒| 先锋影音网一区二区| 欧美不卡视频一区发布| 一本大道久久a久久综合婷婷 | 在线一区欧美| 久久久久99| 欧美日韩一区国产| 又紧又大又爽精品一区二区| 99国产精品久久久久老师| 午夜欧美精品久久久久久久| 欧美freesex8一10精品| 99亚洲精品| 久久美女性网| 国产精品高潮呻吟久久av黑人| 在线不卡中文字幕播放| 亚洲欧美日韩在线观看a三区| 猫咪成人在线观看| 这里只有视频精品| 欧美大成色www永久网站婷| 国产欧美精品一区二区三区介绍 | 亚洲成人在线观看视频| 久久一区激情| 国产欧美在线播放| 亚洲精品系列| 玖玖综合伊人| 午夜精品视频在线| 欧美精品一区二区三区很污很色的 | 欧美激情亚洲激情| 韩国女主播一区二区三区| 一区二区三区视频免费在线观看 | 夜夜嗨av色一区二区不卡| 久久久久www| 国产亚洲毛片在线| 亚洲综合电影一区二区三区| 欧美国产日韩免费| 久久久久久久久一区二区| 国产精品久久网站| 中文亚洲视频在线| 亚洲人成网站在线观看播放| 久久精品视频亚洲| 国产日韩精品在线| 欧美一区二区三区四区在线| 一区二区三区不卡视频在线观看 | 免费国产一区二区| 久久精品久久99精品久久| 国产区在线观看成人精品| 亚洲女同精品视频| 一本久久青青| 国产精品福利片| 亚洲欧美日韩精品久久亚洲区| 亚洲靠逼com| 欧美日韩国产一级片| 日韩视频―中文字幕| 亚洲国产精品久久久久婷婷老年| 久久亚洲精品一区| 亚洲国产精品女人久久久| 欧美成人伊人久久综合网| 久久综合给合| 亚洲精品乱码久久久久久黑人| 亚洲电影有码| 欧美日本一区|