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

天行健 君子當自強而不息

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)  編輯 收藏 引用


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


公告

導航

統(tǒng)計

常用鏈接

隨筆分類(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>
            国产精品你懂的在线欣赏| 国产一区二区日韩| 亚洲欧洲综合| 亚洲第一精品夜夜躁人人躁| 久久久噜噜噜久久| 亚洲电影在线| 欧美激情精品久久久六区热门| 久久久久久国产精品mv| 亚洲大胆美女视频| 亚洲娇小video精品| 欧美高清影院| 亚洲一卡二卡三卡四卡五卡| 亚洲天堂免费观看| 国产欧美精品一区| 乱中年女人伦av一区二区| 久久在精品线影院精品国产| 亚洲乱码一区二区| 宅男噜噜噜66国产日韩在线观看| 国产精品欧美久久| 久久三级视频| 欧美福利一区二区三区| 亚洲一区二区三区四区五区午夜| 亚洲伊人一本大道中文字幕| 韩国av一区二区| 亚洲激情中文1区| 国产精品国产三级国产专播品爱网 | 蜜臀99久久精品久久久久久软件| 亚洲黄色av一区| 一区二区三区 在线观看视| 国产精品一区二区黑丝| 久久一区视频| 欧美午夜在线一二页| 久久久免费观看视频| 欧美激情网友自拍| 久久九九精品99国产精品| 裸体素人女欧美日韩| 亚洲影视在线播放| 欧美一区二区女人| 一区二区三区欧美亚洲| 欧美一区二区三区免费在线看| 亚洲人成网站精品片在线观看 | 欧美激情综合色| 国产精品美女久久久久av超清| 久久青草久久| 国产精品爱啪在线线免费观看 | 亚洲美女精品一区| 国产美女精品视频免费观看| 亚洲精品一区二区三区在线观看| 久久久免费精品视频| 国产日韩欧美二区| 亚洲国产成人精品久久久国产成人一区 | 久久激情婷婷| 免费一区二区三区| 欧美激情综合| 久久综合伊人77777尤物| 亚洲欧洲视频在线| 国产精品任我爽爆在线播放 | 日韩亚洲欧美成人一区| 亚洲欧洲在线一区| 亚洲少妇最新在线视频| 国内精品伊人久久久久av一坑| 性8sex亚洲区入口| 欧美成人精品| 欧美一区二区三区免费在线看| 黄色精品一区| 欧美日韩国产亚洲一区| 亚洲欧美日韩精品久久久久| 亚洲第一在线| 亚洲国产精彩中文乱码av在线播放| 香蕉视频成人在线观看| 亚洲免费福利视频| 日韩亚洲欧美精品| 亚洲午夜精品久久久久久app| 一区二区三区国产精品| 亚洲美女免费精品视频在线观看| 国产精品美女久久久| 欧美精彩视频一区二区三区| 欧美成人精品1314www| 日韩亚洲视频在线| 永久免费毛片在线播放不卡| 性做久久久久久久免费看| 久久国产精品久久久| 国产精品视频网| 99精品久久| 亚洲尤物在线视频观看| 欧美日韩免费一区二区三区视频| 亚洲欧洲三级| 一区二区三区视频在线| 最新日韩av| 亚洲国产1区| 亚洲国产日韩欧美在线99| 亚洲高清一区二区三区| 欧美xx视频| 日韩香蕉视频| 午夜精品一区二区三区电影天堂 | 久久一区中文字幕| 欧美激情影音先锋| 日韩一区二区精品在线观看| 欧美激情一区二区三区全黄| 日韩一级黄色片| 性色av一区二区三区| 国产综合视频| 欧美国产一区视频在线观看| 99av国产精品欲麻豆| 久久久久久久久久久久久久一区 | 欧美片在线播放| 亚洲一级二级| 免费不卡中文字幕视频| 一本色道久久88综合日韩精品| 国产精品国产精品国产专区不蜜| 欧美一区二区三区四区高清| 欧美成人免费观看| 午夜精品久久一牛影视| 亚洲高清精品中出| 国产精品国产三级国产普通话三级 | 亚洲一区二区欧美日韩| 今天的高清视频免费播放成人 | 久久久久久久999| av成人老司机| 免费欧美在线视频| 午夜天堂精品久久久久| 亚洲精品123区| 国产九九精品| 欧美少妇一区| 美女网站在线免费欧美精品| 中文亚洲视频在线| 欧美激情久久久久| 久久女同精品一区二区| 亚洲一区黄色| 亚洲精品在线视频观看| 伊人一区二区三区久久精品| 国产精品久久久久久久久久三级| 欧美a级理论片| 久久精品亚洲精品| 性伦欧美刺激片在线观看| 亚洲精品视频一区| 亚洲第一在线视频| 久久夜色精品国产亚洲aⅴ| 午夜伦理片一区| 亚洲午夜成aⅴ人片| 亚洲精品四区| 亚洲三级视频在线观看| 欲香欲色天天天综合和网| 国产亚洲综合精品| 国产日韩精品一区| 国产欧美精品一区| 国产欧美一二三区| 国产精品久久久久久久7电影| 欧美日本一道本在线视频| 欧美黄色免费| 欧美久久九九| 欧美视频一区| 国产精品永久免费视频| 国产美女精品人人做人人爽| 国产精品久久中文| 国产午夜亚洲精品不卡| 国产综合久久久久久| 国产亚洲精品一区二区| 国产一区二区三区在线观看免费 | 欧美系列一区| 国产精品av免费在线观看| 欧美午夜精品久久久久久久| 国产精品久久久久久影院8一贰佰 国产精品久久久久久影视 | 久久久精品日韩欧美| 久久久久免费| 麻豆成人综合网| 裸体一区二区三区| 亚洲成色777777在线观看影院| 亚洲国产成人久久综合| 99亚洲一区二区| 亚洲一区二区三区四区在线观看 | 亚洲欧美日韩在线高清直播| 欧美一区二区三区久久精品| 久久精品人人做人人爽电影蜜月| 久久亚洲欧美| 欧美日韩在线第一页| 国产精品日韩精品欧美精品| 国产日韩专区| 91久久夜色精品国产九色| 国产精品99久久久久久人| 西瓜成人精品人成网站| 久久久久成人精品| 欧美黄色日本| 亚洲视频在线看| 久久精品亚洲精品| 欧美日韩综合视频| 国产综合第一页| 夜色激情一区二区| 久久精品视频99| 亚洲三级免费| 久久精品91久久久久久再现| 欧美成人一区二区三区在线观看 | 欧美1级日本1级| 国产精品午夜电影| 亚洲伦理在线免费看| 久久国产精品色婷婷| 亚洲三级电影在线观看| 欧美伊人影院| 国产精品久久久久久久app| 亚洲黄色尤物视频|