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

天行健 君子當自強而不息

Controlling Players and Characters(19)

 

The Function of Spells
 

The functional component of a spell does the real work. Once a spell runs through
its animation and reaches its intended target, the damaging or beneficial effects
need to be dealt with.

Healing spells need to restore health to an injured character, whereas damaging
spells need to take away health. In fact, just about any aspect of a character can be
altered from a spell, ranging from characters’ health and mana to their abilities
such as attack or defense. In Table 16.5, I define the effects that can be used as a
spell effect.

Each spell effect has a supporting value defined in the source code as an enum
object that is defined as follows:

enum SpellEffects {
  ALTER_HEALTH = 0,
  ALTER_MANA,
  CURE_AILMENT,
  CAUSE_AILMENT,
  RAISE_DEAD,
  INSTANT_KILL,
  DISPEL_MAGIC,
  TELEPORT
};

Each spell effect is assigned a number. In that way, you can contain the processing
of a spell effect within a single switch statement, as in the following:

switch(SpellEffect) {
  case ALTER_HEALTH:
    // do health altering processing
  case ALTER_MANA:
    // do mana alter processing
    ...
}

Each spell effect is pretty straightforward. Now, take a closer look at just what each
of these effects do.

 

Alter Health and Mana
 

A spell can cause damage or rob characters of their stored mana, or it can, on the
other hand, restore health or mana. Alteration of health is probably the most widely
used spell effect.
 

A health altering spell has an associated value that determines how much health is
removed or added to the target character. The same applies to mana points, which
can be restored or drained away with the mere flick of a wizard’s hand.

 

Cure and Cause Ailment


Status ailments are the bane and bonus of a character’s abilities and attributes. The
duo of curing and causing spell effects gives you great freedom in devising how to
curse or what to bestow upon a character.


When you alter an ailment (cause or cure), you must use a bit-encoded number to
define the ailment. By using bit flags, more than one status ailment can be caused
or cured at once. Each ailment has an associated macro defined as follows:

#define AILMENT_POISON 1
#define AILMENT_SLEEP 2
#define AILMENT_PARALYZE 4
#define AILMENT_WEAK 8
#define AILMENT_STRONG 16
#define AILMENT_ENCHANTED 32
#define AILMENT_BARRIER 64
#define AILMENT_DUMBFOUNDED 128
#define AILMENT_CLUMSY 256
#define AILMENT_SUREFOOTED 512
#define AILMENT_SLOW 1024
#define AILMENT_FAST 2048
#define AILMENT_BLIND 4096
#define AILMENT_HAWKEYE 8192
#define AILMENT_SILENCED 16384

Character ailments are stored within a single 32-bit variable, and all characters have
an ailment variable associated with them. That’s right, any character in your game
can be burdened with status ailments, but it is harder to afflict characters that have
a higher resistance.

 

Raise Dead and Instant Kill


At times, your poor characters are going to die, and except for MCs, you want the
ability to raise them from the dead. The raise dead spell effect does just that—
raises PC or NPC characters from death and gives them exactly one health point.


On the flip side, there will be times when you just want to strike a monster down in
one blow. That’s the purpose of the instance kill effect. Although having little
chance of working, the instant kill ability is still a force to be reckoned with.

 

Dispel Magic


Forget all those status ailment-curing spells; why not just get rid of them all in one
shot! The dispel effect clears a target character’s ailments, whether good or bad,
and although this effect can be represented as a cure ailment effect, it becomes
much easier to not use bit flags.

 

Teleport


Other than walking around, the best way to travel is to magically teleport around.
Only PCs can use this spell. Teleporting can move a PC to any position on a map.


posted on 2007-11-16 14:24 lovedday 閱讀(202) 評論(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>
            亚洲国产高清视频| 亚洲国产美女| 亚洲欧美成aⅴ人在线观看| 欧美激情片在线观看| 噜噜噜91成人网| 亚洲人成网站影音先锋播放| 欧美高清在线视频| 欧美精彩视频一区二区三区| 99精品欧美一区| 亚洲婷婷免费| 国产亚洲成av人在线观看导航| 久久国产精品久久久久久久久久| 欧美在线观看网站| 亚洲大胆美女视频| 亚洲精品久久久久久久久久久久久| 欧美日韩午夜精品| 欧美一区二区三区啪啪| 久久久久久夜| 一本色道久久99精品综合 | 亚洲日本va午夜在线电影| 最新国产乱人伦偷精品免费网站 | 欧美三级视频在线| 久久国产精彩视频| 乱人伦精品视频在线观看| 一本久久综合亚洲鲁鲁| 亚洲资源av| 亚洲国内高清视频| 一区二区三区欧美激情| 在线高清一区| 亚洲视频一区二区| 影音先锋一区| 一区二区三区国产在线观看| 好看的亚洲午夜视频在线| 亚洲欧洲偷拍精品| 狠狠色噜噜狠狠狠狠色吗综合| 91久久精品国产| 国内精品模特av私拍在线观看| 亚洲国产成人不卡| 国产在线日韩| 日韩午夜激情av| 亚洲国产天堂久久国产91| 亚洲一区二区三区视频播放| 亚洲国产美女| 久久福利毛片| 午夜一区二区三区在线观看| 欧美精品三区| 美女久久网站| 国内免费精品永久在线视频| 一本一本久久a久久精品综合妖精 一本一本久久a久久精品综合麻豆 | 久久久久一区二区三区| 欧美日韩精品三区| 欧美激情区在线播放| 国产酒店精品激情| 一本色道久久88综合日韩精品| …久久精品99久久香蕉国产| 羞羞答答国产精品www一本| 一区二区三区四区五区视频 | 老色批av在线精品| 久久午夜精品| 国产三区精品| 亚洲欧美中文另类| 午夜视频在线观看一区二区| 欧美性做爰猛烈叫床潮| 一本色道久久综合狠狠躁的推荐| 日韩视频一区二区三区| 欧美国产日韩一区二区| 最新中文字幕一区二区三区| 亚洲精品欧美极品| 欧美激情久久久久| 麻豆精品在线视频| 亚洲国产精品久久久久秋霞不卡| 久久在线免费视频| 亚洲激情在线观看视频免费| 日韩一级在线观看| 欧美日韩日韩| 亚洲欧美国产一区二区三区| 欧美在线观看网站| 黑人巨大精品欧美一区二区| 久久久视频精品| 蜜臀av一级做a爰片久久| 一区免费观看视频| 久久久久欧美| 欧美二区视频| 亚洲国产婷婷香蕉久久久久久| 久久成人资源| 久久精品91| 国产一区二区高清| 久久精品欧美日韩精品| 欧美中文字幕第一页| 欧美性猛交99久久久久99按摩| 亚洲欧洲精品一区二区| 99香蕉国产精品偷在线观看| 欧美精品一区二区三区久久久竹菊 | 久久精品一本| 欧美xx视频| 99re66热这里只有精品3直播| 欧美激情成人在线| 亚洲人成高清| 久久超碰97人人做人人爱| 国产丝袜美腿一区二区三区| 久久国产手机看片| 欧美国产日韩亚洲一区| 亚洲精品久久视频| 欧美日韩综合精品| 亚洲免费网站| 最新中文字幕亚洲| 亚洲欧美日韩在线高清直播| 国产精品一卡| 久久只有精品| 亚洲图片在区色| 久久精品国产在热久久| 亚洲国产1区| 欧美午夜宅男影院在线观看| 欧美在线首页| 最新亚洲一区| 欧美中文在线视频| 亚洲高清视频在线| 欧美午夜精彩| 欧美一区二区免费视频| 一区二区三区波多野结衣在线观看| 亚洲欧美日产图| 亚洲人成在线观看| 国产亚洲一区二区三区在线观看| 男人的天堂亚洲在线| 午夜精品一区二区三区四区 | 亚洲天天影视| 久久精品国产99| 亚洲区一区二| 国产精品www| 欧美日韩国产精品一卡| 性色av一区二区三区在线观看| 欧美成人在线免费视频| 午夜精品久久久久久久99热浪潮| 亚洲国产电影| 国产一区二区三区免费不卡 | 久久国产精品久久久久久电车| 91久久久在线| 另类欧美日韩国产在线| 亚洲一区欧美激情| 亚洲精品影院| 亚洲第一狼人社区| 国产视频一区在线观看一区免费 | 亚洲欧洲日韩女同| 欧美激情a∨在线视频播放| 久久久人成影片一区二区三区| 亚洲天堂黄色| 亚洲性感美女99在线| 日韩写真在线| 怡红院av一区二区三区| 在线观看三级视频欧美| 狠狠色狠狠色综合系列| 国产亚洲午夜高清国产拍精品| 国产精品成人一区二区网站软件| 欧美激情一区二区三区全黄 | 久久夜色精品国产欧美乱| 久久久久综合| 久久天天综合| 久久综合九色欧美综合狠狠| 久久国产精品99国产| 久久成人人人人精品欧| 亚洲欧美日韩国产成人精品影院| 欧美在线观看一二区| 欧美有码在线视频| 久久国产精品99久久久久久老狼 | 在线播放豆国产99亚洲| 樱桃国产成人精品视频| 亚洲国产精品成人一区二区| 亚洲国产精彩中文乱码av在线播放| 亚洲第一网站| 亚洲欧洲在线视频| 一本色道久久| 欧美亚洲三区| 久久精品国产精品| 久久久久国内| 亚洲欧洲日本国产| 一本色道久久| 先锋影音国产精品| 久久青青草综合| 欧美激情91| 国产一区二区三区网站| 影音先锋亚洲视频| a4yy欧美一区二区三区| 午夜精品国产精品大乳美女| 久久精品国产99国产精品澳门| 欧美激情在线免费观看| 一区二区欧美亚洲| 欧美在线亚洲在线| 欧美国产精品一区| 国产精品久久久久aaaa| 一区二区视频免费完整版观看| 日韩一区二区免费高清| 亚洲女人av| 免费试看一区| 亚洲午夜电影在线观看| 久久亚洲风情| 欧美精品一区二| 在线观看欧美成人| 亚洲一区二区四区| 欧美~级网站不卡| 亚洲一区二区在线播放|