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

天行健 君子當自強而不息

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>
            亚洲午夜视频| 亚洲综合视频一区| 欧美成人一区二区| 亚洲精选一区二区| 日韩午夜av在线| 欧美三级视频| 亚洲欧美日韩另类| 欧美亚洲一区二区在线观看| 国产欧美日本一区二区三区| 久久一区激情| 欧美高清在线播放| 午夜精品福利一区二区三区av| 亚洲欧美日韩另类精品一区二区三区| 国产亚洲精品一区二区| 美国三级日本三级久久99| 欧美va亚洲va香蕉在线| 亚洲免费观看| 亚洲一区二区在| 尹人成人综合网| 亚洲欧洲午夜| 国产日韩精品一区| 亚洲电影在线| 国产伦精品一区二区| 噜噜噜躁狠狠躁狠狠精品视频| 欧美国产精品专区| 久久riav二区三区| 免费亚洲电影| 欧美在线免费观看视频| 欧美成人精品高清在线播放| 亚洲欧美日韩国产一区| 美女爽到呻吟久久久久| 亚欧成人在线| 欧美激情欧美激情在线五月| 欧美一区成人| 欧美日产国产成人免费图片| 久久成人这里只有精品| 欧美日韩大陆在线| 男同欧美伦乱| 国产日产欧美精品| 亚洲精品乱码久久久久| 伊人久久大香线| 亚洲欧美在线免费| 亚洲视频在线播放| 免费美女久久99| 鲁大师成人一区二区三区| 欧美色中文字幕| 欧美黄色精品| 伊人成人开心激情综合网| 亚洲欧美一级二级三级| 99视频精品在线| 免费不卡中文字幕视频| 久久精品一区二区三区不卡牛牛| 国产精品s色| 亚洲韩日在线| 亚洲欧洲精品一区二区三区不卡| 久久精品伊人| 久久久国产精品一区| 国产乱人伦精品一区二区| 99综合在线| 在线视频日本亚洲性| 欧美日韩高清区| 亚洲日韩视频| 一区二区日韩精品| 欧美激情一二三区| 亚洲国产天堂久久综合| 亚洲精品欧美| 欧美美女福利视频| 亚洲精品乱码久久久久| aa成人免费视频| 欧美巨乳波霸| 一本一道久久综合狠狠老精东影业 | 欧美一级二区| 国产精品色一区二区三区| 99re8这里有精品热视频免费 | 国产日本欧美一区二区三区| 亚洲一区久久久| 欧美一区二区三区四区视频| 国产精品欧美一区二区三区奶水| 在线视频你懂得一区二区三区| 亚洲少妇最新在线视频| 欧美日韩一区二区免费在线观看| aa级大片欧美| 午夜一区在线| 国产亚洲欧洲| 久久嫩草精品久久久精品| 欧美国产日本在线| 一本高清dvd不卡在线观看| 欧美揉bbbbb揉bbbbb| 午夜精品视频在线观看一区二区| 久久精品视频va| 亚洲国产精品久久久| 欧美日本韩国在线| 在线亚洲激情| 久久在线免费视频| 亚洲欧洲综合另类| 欧美婷婷六月丁香综合色| 欧美一级网站| 亚洲欧洲三级电影| 欧美专区中文字幕| 亚洲人成在线播放| 国产精品普通话对白| 欧美中文字幕在线视频| 亚洲国产天堂久久国产91| 午夜精品福利视频| 91久久精品国产91性色| 欧美午夜精品理论片a级大开眼界| 欧美亚洲在线观看| 亚洲精品国产精品乱码不99按摩| 小黄鸭视频精品导航| 亚洲激情av| 国产欧美精品在线| 欧美精品在线一区二区三区| 午夜精品免费| 日韩视频在线观看| 欧美成年人视频网站欧美| 西西人体一区二区| 夜夜嗨av一区二区三区免费区| 国产午夜精品理论片a级大结局 | 欧美激情综合网| 欧美一区不卡| 99成人在线| 欧美激情精品久久久| 欧美在线免费看| 亚洲一二三区在线| 亚洲精品国久久99热| 国内久久视频| 国产美女精品视频免费观看| 欧美激情精品久久久六区热门| 久久黄金**| 亚洲在线观看视频| 99国产精品| 亚洲高清在线视频| 玖玖国产精品视频| 久久久噜噜噜久久中文字幕色伊伊| 一本久久青青| 一本色道久久综合亚洲二区三区| 亚洲国产精品第一区二区三区| 国产在线一区二区三区四区| 国产精品一区二区久久| 国产精品色婷婷| 欧美天天在线| 国产精品乱人伦中文| 欧美午夜a级限制福利片| 欧美精品高清视频| 欧美久久电影| 欧美视频你懂的| 国产精品视频成人| 国产精品区一区二区三| 国产精品免费小视频| 国产精品嫩草久久久久| 国产精品自拍三区| 国产午夜精品视频| 国外成人在线视频网站| 亚洲成人资源| 日韩视频在线你懂得| 亚洲视频在线视频| 欧美一区二区三区免费观看视频| 香蕉乱码成人久久天堂爱免费| 欧美一区二区三区免费观看| 久久久亚洲国产天美传媒修理工 | 午夜久久久久久| 久久精品1区| 你懂的亚洲视频| 亚洲精品你懂的| 亚洲一二三区视频在线观看| 小辣椒精品导航| 久久噜噜噜精品国产亚洲综合| 乱中年女人伦av一区二区| 欧美精品在线观看91| 国产精品草草| 狠狠色狠狠色综合日日91app| 在线不卡a资源高清| 亚洲日本成人网| 亚洲深夜福利网站| 久久精品国产亚洲高清剧情介绍| 毛片一区二区三区| 一本色道久久综合亚洲二区三区 | 欧美激情第六页| 亚洲网站视频福利| 久久亚洲综合网| 国产精品videossex久久发布| 国产视频久久久久| 亚洲精品久久久久久久久久久 | 亚洲精品网址在线观看| 亚洲综合色激情五月| 欧美福利一区二区三区| 亚洲影院免费| 欧美本精品男人aⅴ天堂| 国产精品一卡二卡| 亚洲美女精品一区| 久久精品国产久精国产爱| 亚洲三级电影在线观看| 久久久91精品国产| 欧美午夜精品| 亚洲精品久久久一区二区三区| 久久国产精品一区二区三区四区| 亚洲激情不卡| 久久一区二区三区四区五区| 国产精品天美传媒入口| 中文精品在线|