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

天行健 君子當自強而不息

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>
            欧美成在线观看| 亚洲激情国产| 亚洲综合国产激情另类一区| 欧美日韩亚洲一区二区三区在线观看 | 亚洲日本精品国产第一区| 美女黄色成人网| 99精品欧美一区| 亚洲视频视频在线| 国产一区在线观看视频| 久久亚洲免费| 欧美大成色www永久网站婷| 中文精品一区二区三区| 亚洲视频视频在线| 狠狠色伊人亚洲综合成人| 欧美成人精品一区二区三区| 欧美日本亚洲视频| 午夜亚洲伦理| 久久一区激情| 亚洲一区中文字幕在线观看| 欧美在线视频a| 亚洲韩国精品一区| 中文欧美字幕免费| 在线成人av网站| 一区二区三区精品视频在线观看| 国产一二三精品| 亚洲精品欧美| 欧美精品性视频| 久久午夜电影网| 欧美精品一区二| 久久精品中文字幕一区| 欧美精品日韩www.p站| 欧美一区二区精美| 欧美极品影院| 免费看的黄色欧美网站| 国产精品porn| 亚洲国产小视频在线观看| 国产喷白浆一区二区三区| 亚洲第一中文字幕| 国产一区二区日韩精品欧美精品 | 亚洲一级片在线观看| 久久久久久久久蜜桃| 亚洲欧美日韩一区二区三区在线观看 | 精品成人在线视频| 一区二区三区鲁丝不卡| 亚洲激情国产精品| 欧美一区二区| 午夜精品影院在线观看| 欧美破处大片在线视频| 欧美顶级艳妇交换群宴| 黑人巨大精品欧美一区二区小视频 | 一本久久综合亚洲鲁鲁| 久久免费偷拍视频| 久久精品在这里| 国产精品一二三四| 99pao成人国产永久免费视频| 亚洲国产欧洲综合997久久| 欧美在线视频在线播放完整版免费观看| 亚洲婷婷综合色高清在线| 欧美国产视频日韩| 亚洲高清在线视频| 亚洲国产精品99久久久久久久久| 先锋a资源在线看亚洲| 午夜久久福利| 国产精品一二三| 亚洲一区二区成人| 午夜在线精品偷拍| 国产精品视频一区二区高潮| 亚洲一区二区免费| 欧美一级免费视频| 国产区精品视频| 欧美一区二区三区免费视频| 久久久久久九九九九| 精品动漫3d一区二区三区免费 | 亚洲毛片在线看| 一区二区三区日韩精品视频| 欧美精品亚洲| 中国成人黄色视屏| 午夜一区在线| 国产综合久久久久久| 久久精品久久综合| 欧美大片在线观看一区| 亚洲精品在线三区| 国产精品久久久久7777婷婷| 午夜精品国产| 欧美成人亚洲成人日韩成人| 亚洲免费观看高清在线观看| 欧美日韩另类在线| 亚洲欧美国产精品桃花| 蜜臀va亚洲va欧美va天堂| 亚洲精品国偷自产在线99热| 欧美日韩另类字幕中文| 香蕉久久一区二区不卡无毒影院 | 亚洲一区二区免费| 国产麻豆一精品一av一免费| 欧美中文字幕精品| 欧美国产综合视频| 亚洲先锋成人| 国产一区日韩一区| 欧美福利一区| 亚洲一区日韩| 亚洲国产经典视频| 亚洲欧美国产精品桃花| 韩日欧美一区二区| 欧美日韩精品一区二区三区| 性色av香蕉一区二区| 亚洲国产精品电影| 久久精品国产欧美亚洲人人爽| 国产专区欧美精品| 欧美日韩少妇| 久久久久欧美| 亚洲一卡久久| 亚洲国产精品一区| 亚洲男人的天堂在线观看 | 欧美精品一区二区三区四区 | 久久夜色精品国产欧美乱| av成人毛片| 精品成人一区| 国产精品亚洲综合一区在线观看| 欧美国产综合视频| 久久九九全国免费精品观看| 99国产精品99久久久久久粉嫩 | 日韩亚洲成人av在线| 国产亚洲永久域名| 欧美日韩午夜激情| 欧美高清视频在线| 久久久久久一区二区| 午夜精品一区二区三区在线视 | 麻豆成人在线| 欧美一区中文字幕| 亚洲自拍偷拍福利| 日韩午夜激情电影| 亚洲高清视频在线观看| 免费在线观看一区二区| 欧美在线观看网址综合| 亚洲永久网站| 亚洲一区精品视频| 一区二区欧美视频| 亚洲九九爱视频| 亚洲国产成人精品女人久久久| 国产视频综合在线| 国产欧美在线视频| 国产色爱av资源综合区| 国产精品永久免费视频| 国产精品日韩精品| 国产精品丝袜xxxxxxx| 国产精品欧美一区二区三区奶水| 欧美日韩一区二区视频在线观看| 欧美精品18videos性欧美| 欧美激情综合网| 欧美片网站免费| 欧美四级在线观看| 国产精品视频免费观看| 国产日韩欧美在线视频观看| 国产欧美日韩精品一区| 国产亚洲精品aa| 精品99一区二区三区| 亚洲国产欧美不卡在线观看| 亚洲精品激情| 亚洲视频在线看| 性做久久久久久久免费看| 欧美影院成年免费版| 久久综合成人精品亚洲另类欧美 | aaa亚洲精品一二三区| 一区二区黄色| 午夜精品久久久久久久99黑人| 亚洲欧美日韩国产精品| 欧美一区二区精美| 免费成人小视频| 亚洲精品一区二区三区蜜桃久| 中文国产亚洲喷潮| 欧美中文在线观看| 欧美成人自拍| 国产精品色午夜在线观看| 国产综合欧美| 99av国产精品欲麻豆| 午夜国产不卡在线观看视频| 久久亚洲精品一区| 亚洲九九精品| 欧美有码视频| 欧美精品一卡| 国产综合精品| 亚洲午夜电影网| 美女精品在线观看| 99一区二区| 久久综合久久综合久久综合| 欧美日韩精品免费看| 国产在线不卡视频| 一区二区动漫| 欧美成人午夜激情在线| 亚洲综合成人在线| 欧美精品1区2区3区| 国产日本欧美在线观看| 亚洲免费av电影| 鲁鲁狠狠狠7777一区二区| 一区二区三区国产在线| 美女黄网久久| 一区二区三区在线免费播放| 亚洲欧美日韩精品久久久久| 亚洲激情亚洲| 久久综合伊人77777蜜臀|