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

天行健 君子當自強而不息

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>
            欧美日韩美女在线观看| 欧美另类一区| 国产一区二区三区四区hd| 欧美一级片在线播放| 亚洲小说欧美另类社区| 国产精品一区一区| 久久久久久有精品国产| 久久综合九色综合久99| 亚洲毛片一区| 在线一区二区三区四区| 国产一区91| 欧美电影免费观看高清完整版| 蜜臀91精品一区二区三区| 一本一道久久综合狠狠老精东影业| 亚洲精品孕妇| 国产日韩成人精品| 欧美激情一区二区三区蜜桃视频| 欧美日韩午夜激情| 久久激情视频| 牛牛国产精品| 欧美亚洲一区在线| 欧美www视频在线观看| 亚洲在线免费视频| 久久久精品网| 亚洲一区二区精品在线| 欧美一区二区视频网站| 日韩视频免费观看| 欧美亚洲一区在线| 亚洲国产影院| 亚洲欧美日韩综合aⅴ视频| 激情久久五月天| 99精品欧美一区二区三区综合在线 | 蜜臀久久99精品久久久久久9| 欧美1区2区| 久久精品色图| 欧美日韩国产另类不卡| 久久婷婷国产综合精品青草| 欧美女激情福利| 久久在精品线影院精品国产| 欧美日韩视频在线观看一区二区三区| 久久久噜噜噜久久狠狠50岁| 欧美日韩在线第一页| 久久综合伊人77777蜜臀| 国产精品久久久久毛片软件| 欧美二区在线播放| 韩日欧美一区二区三区| 亚洲午夜小视频| 日韩视频一区二区三区在线播放免费观看 | 亚洲一区二区三区四区中文 | 欧美日韩亚洲高清| 欧美国产日韩免费| 国产一区二区三区在线播放免费观看| 亚洲免费电影在线观看| 永久91嫩草亚洲精品人人| 小处雏高清一区二区三区| 中日韩视频在线观看| 欧美福利视频在线| 免费一区二区三区| 激情综合中文娱乐网| 午夜在线视频观看日韩17c| 亚洲欧美日韩久久精品| 国产精品电影网站| 日韩一级片网址| 在线一区二区日韩| 欧美日韩三级| 一本大道久久精品懂色aⅴ| 一本色道综合亚洲| 欧美日韩亚洲一区二区三区| 亚洲人成在线播放网站岛国| 亚洲高清免费在线| 女主播福利一区| 亚洲国产福利在线| 99re66热这里只有精品4| 欧美福利一区二区三区| 亚洲日本成人| 亚洲一级高清| 国产日产精品一区二区三区四区的观看方式 | 久久精品国产96久久久香蕉| 国产区欧美区日韩区| 欧美综合二区| 六月丁香综合| 亚洲精品偷拍| 欧美日韩另类一区| 亚洲图片在线观看| 久久成人在线| 亚洲国产精品999| 欧美剧在线观看| 一区二区三区四区五区精品视频| 亚洲影院在线观看| 国产综合色在线| 免费日韩av| 亚洲视频观看| 美女视频黄a大片欧美| 亚洲开发第一视频在线播放| 欧美日韩亚洲一区二区三区| 校园春色综合网| 亚洲第一页在线| 亚洲欧美日韩一区二区在线| 在线观看91精品国产麻豆| 欧美国产免费| 性色一区二区三区| 亚洲区一区二| 久久成人精品无人区| 亚洲片国产一区一级在线观看| 欧美日韩另类丝袜其他| 久久国产精品电影| 亚洲区免费影片| 久久久久久久综合| 在线性视频日韩欧美| 黄色另类av| 国产精品久久久久久久app| 久久久久国产一区二区三区| 99精品国产高清一区二区| 欧美自拍丝袜亚洲| 一本色道综合亚洲| 亚洲成人影音| 国产女主播视频一区二区| 欧美aaaaaaaa牛牛影院| 午夜精品一区二区三区在线播放| 欧美激情影院| 久久―日本道色综合久久| 亚洲视频在线二区| 亚洲啪啪91| 精品成人一区二区三区四区| 国产精品久久久久久模特| 欧美黄色片免费观看| 久久久天天操| 欧美一区二区视频在线| 在线中文字幕一区| 99精品国产在热久久下载| 亚洲精美视频| 欧美国产精品v| 毛片精品免费在线观看| 欧美专区在线播放| 欧美一二三视频| 午夜精品在线观看| 亚洲综合三区| 亚洲一区二区在线| 亚洲午夜羞羞片| 亚洲自拍三区| 午夜视频在线观看一区二区三区| 国产精品99久久久久久宅男| 99re亚洲国产精品| 日韩视频精品在线观看| 亚洲三级影片| 日韩一区二区高清| 一本大道久久a久久综合婷婷 | 国产精品qvod| 欧美视频在线观看| 欧美性片在线观看| 国产精品高潮呻吟久久| 国产精品久久久对白| 国产精品久久久久91| 国产精一区二区三区| 国产日韩欧美91| 一区二区亚洲欧洲国产日韩| 在线观看精品| 亚洲精品一区二区在线| 夜夜嗨av色一区二区不卡| 99re热这里只有精品免费视频| 一本一本久久a久久精品综合妖精| 一区二区三区视频在线看| 亚洲视频精品| 欧美中文字幕精品| 免费试看一区| 日韩视频一区二区三区在线播放免费观看| av不卡在线观看| 欧美一区二区免费观在线| 久久久久看片| 欧美日本一道本| 国产日韩精品一区二区浪潮av| 激情久久综艺| 在线视频日本亚洲性| 久久久久.com| 亚洲国产欧美不卡在线观看| 一区二区三区波多野结衣在线观看| 亚洲欧美成人精品| 麻豆成人在线| 国产精品日韩欧美综合| 亚洲黄色有码视频| 亚洲主播在线| 欧美华人在线视频| 亚洲在线网站| 欧美成人精品在线观看| 国产精品亚洲美女av网站| 亚洲国产日韩欧美在线动漫| 亚洲一区二区视频在线| 欧美成人一二三| 亚洲欧美国产三级| 欧美高清视频一区| 国产自产女人91一区在线观看| 99热在这里有精品免费| 久久久久91| 亚洲午夜一级| 欧美激情第8页| 在线日本高清免费不卡| 欧美在线1区| 99re6这里只有精品视频在线观看| 久久久www| 国产日韩专区|