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

天行健 君子當(dāng)自強(qiáng)而不息

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 閱讀(151) 評(píng)論(0)  編輯 收藏 引用


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


公告

導(dǎo)航

統(tǒng)計(jì)

常用鏈接

隨筆分類(178)

3D游戲編程相關(guān)鏈接

搜索

最新評(píng)論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            久久成人综合视频| 国产精品一区二区三区久久 | 国产欧美日韩中文字幕在线| 国产精品久久久久久av下载红粉| 欧美午夜精品理论片a级按摩| 欧美午夜精品久久久久久人妖| 欧美视频在线一区| 国产欧美一区在线| 伊人男人综合视频网| 亚洲精品欧美激情| 午夜精品久久久久久久99水蜜桃| 欧美在线视频在线播放完整版免费观看| 久久久久久自在自线| 亚洲第一精品电影| 91久久在线播放| 午夜电影亚洲| 欧美—级高清免费播放| 国产精品久久久久久久久久尿| 国产一区二区精品久久91| 最新高清无码专区| 久久黄色级2电影| 亚洲另类在线视频| 久久精品国产亚洲aⅴ| 欧美精品成人| 国产一区二区三区网站| 99视频一区二区| 久久久久国产精品一区二区| 日韩视频不卡| 久久久www| 国产精品久久久久久久久久久久久| 国内精品久久久久影院色 | 鲁大师影院一区二区三区| 亚洲茄子视频| 久久久一区二区三区| 欧美性片在线观看| 亚洲欧洲在线视频| 久久在线免费观看| 亚洲永久视频| 欧美婷婷在线| 99热在这里有精品免费| 欧美+日本+国产+在线a∨观看| 亚洲一级高清| 欧美精品在线观看| 最新成人av在线| 乱中年女人伦av一区二区| 亚洲天堂免费观看| 亚洲国产成人一区| 久久精品色图| 黄色日韩网站视频| 久久精品官网| 小处雏高清一区二区三区| 欧美日韩国产999| 亚洲乱码一区二区| 免费欧美日韩| 一本一本久久a久久精品综合麻豆| 久久精品72免费观看| 国产精品亚洲综合天堂夜夜| 亚洲网站啪啪| 99视频在线观看一区三区| 欧美黄色影院| 99re在线精品| 亚洲精品老司机| 欧美欧美全黄| 中文久久乱码一区二区| 99国产精品国产精品久久| 欧美人与禽猛交乱配视频| 99精品免费视频| 99xxxx成人网| 国产精品一区二区女厕厕| 久久精品九九| 久久中文在线| 亚洲最新视频在线| 亚洲午夜羞羞片| 国产日韩欧美亚洲一区| 久久人人精品| 女人色偷偷aa久久天堂| 一本久久综合亚洲鲁鲁| 亚洲少妇诱惑| 狠狠狠色丁香婷婷综合久久五月 | 免播放器亚洲一区| 9色porny自拍视频一区二区| 一区二区三区视频观看| 国产日韩欧美成人| 欧美国产亚洲精品久久久8v| 欧美日韩三级电影在线| 欧美一区二区三区在线| 久久久久免费视频| 99精品久久久| 男人的天堂成人在线| 美女国内精品自产拍在线播放| 亚洲美女精品久久| 亚洲一区在线视频| 亚洲国产精品久久久久秋霞不卡| 亚洲欧洲一区二区在线播放 | 国产丝袜一区二区三区| 欧美a级理论片| 欧美日韩中文字幕在线视频| 久久精品色图| 欧美日本久久| 久久免费高清视频| 欧美手机在线视频| 免费成人小视频| 国产精品久久久久久影视| 浪潮色综合久久天堂| 国产精品二区在线| 欧美激情精品久久久久| 国产日韩高清一区二区三区在线| 亚洲国产毛片完整版| 国产在线拍揄自揄视频不卡99| 91久久精品日日躁夜夜躁国产| 国产午夜精品一区理论片飘花 | 亚洲影音一区| 久久免费视频网站| 亚洲欧美日韩在线| 欧美激情综合五月色丁香小说| 久久精品国产一区二区三区| 欧美日韩亚洲视频| 欧美国产日产韩国视频| 国产在线拍揄自揄视频不卡99| 99精品视频免费观看视频| 亚洲人成网站在线播| 久久久高清一区二区三区| 香蕉成人啪国产精品视频综合网| 欧美精品激情在线| 欧美激情自拍| 亚洲高清免费在线| 久久色中文字幕| 久久深夜福利| 国产综合精品| 久久av在线看| 久久看片网站| 禁久久精品乱码| 久久蜜桃精品| 欧美国产成人精品| 亚洲欧洲日韩在线| 欧美国产另类| 亚洲精品激情| 亚洲一级黄色av| 欧美午夜www高清视频| 一本色道久久综合狠狠躁篇怎么玩 | 久久久欧美一区二区| 国产亚洲欧美另类中文 | 亚洲电影第1页| 一区在线视频观看| 久久精品视频va| 欧美高清不卡| 99视频一区二区| 欧美性大战xxxxx久久久| 中文一区在线| 久久精品视频导航| 亚洲成色精品| 欧美久久99| 一本色道久久88亚洲综合88| 欧美激情精品久久久久久大尺度| 亚洲少妇一区| 国产区精品在线观看| 性欧美18~19sex高清播放| 久久久女女女女999久久| 在线观看亚洲a| 欧美另类专区| 午夜亚洲影视| 亚洲影院在线| 精品成人国产| 欧美精品一区二| 亚洲欧美另类在线观看| 久久综合色播五月| 99精品久久免费看蜜臀剧情介绍| 国产精品久久久久毛片大屁完整版 | 欧美mv日韩mv国产网站| 免费国产一区二区| 在线视频欧美日韩精品| 久久综合给合久久狠狠狠97色69| 亚洲精选国产| 国产欧美日韩在线| 欧美国产亚洲精品久久久8v| 亚洲欧美日韩一区二区三区在线观看 | 樱桃成人精品视频在线播放| 欧美美女bbbb| 久久精品123| 99re热精品| 久久在线91| 亚洲欧美日韩高清| 亚洲激情午夜| 国产午夜一区二区三区| 欧美精品手机在线| 欧美在线观看网站| 99re成人精品视频| 欧美激情一区二区在线| 久久精品91| 亚洲自拍偷拍一区| 亚洲精品一区二| 国产综合久久久久久鬼色| 欧美日一区二区三区在线观看国产免 | 国产毛片一区| 欧美日韩国产综合视频在线观看中文| 香蕉国产精品偷在线观看不卡| 亚洲精品久久久久久下一站 | 亚洲国产专区校园欧美| 国产亚洲精品7777| 欧美三级视频|