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

天行健 君子當自強而不息

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>
            在线观看一区| 亚洲高清在线观看一区| 欧美不卡福利| 久久女同精品一区二区| 欧美色综合天天久久综合精品| 欧美成人午夜| 国内外成人免费激情在线视频| 99精品国产一区二区青青牛奶| 亚洲大胆av| 久久精视频免费在线久久完整在线看| 亚洲欧美日韩国产综合| 欧美精品综合| 亚洲电影在线免费观看| 激情六月综合| 久久精品国产亚洲5555| 久久国产欧美精品| 国产欧美日本| 亚洲综合三区| 性色av一区二区三区红粉影视| 欧美日韩国产综合新一区| 亚洲国产欧美日韩| 亚洲日本aⅴ片在线观看香蕉| 久久久久久国产精品一区| 久久av在线看| 国语自产精品视频在线看8查询8| 午夜精品国产更新| 久久久久五月天| 国内一区二区在线视频观看| 新狼窝色av性久久久久久| 欧美自拍丝袜亚洲| 国产综合久久久久久| 亚洲欧美日韩视频二区| 久久av一区二区三区漫画| 国产欧美一区二区三区在线老狼| 午夜精品久久久久久99热软件| 性欧美大战久久久久久久久| 国产欧美高清| 欧美中文字幕久久| 欧美大片免费看| 亚洲精品欧美精品| 欧美日韩在线一二三| 亚洲男人av电影| 久久天堂国产精品| 亚洲人在线视频| 欧美午夜精品久久久久免费视 | 老司机精品视频网站| 欧美黄色视屏| 亚洲一区不卡| 国产亚洲综合精品| 欧美成人一区二区三区| 亚洲视频网在线直播| 久久精品视频在线播放| 亚洲激情自拍| 国产精品国产三级国产普通话99 | 欧美精品一区二区三区很污很色的| 亚洲精品中文字幕有码专区| 午夜精品理论片| 亚洲国产aⅴ天堂久久| 欧美视频久久| 久久免费国产精品1| 99日韩精品| 美女网站久久| 午夜亚洲伦理| 亚洲激情一区二区| 国产精品美女www爽爽爽视频| 久久精品国产999大香线蕉| 亚洲精品一区在线| 久久久久久网| 亚洲一区二区三区四区五区午夜| 国外成人免费视频| 国产精品sss| 老色鬼精品视频在线观看播放| 中文精品在线| 亚洲国产成人不卡| 欧美专区在线观看| 一本色道久久加勒比精品| 黄色成人在线| 国产精品美女| 欧美精品国产一区| 久久视频在线视频| 香蕉成人久久| 一区二区三区偷拍| 亚洲电影免费| 久久一综合视频| 午夜精品久久久久久久久| 亚洲日本视频| 国语精品一区| 国产精品资源| 国产精品超碰97尤物18| 鲁鲁狠狠狠7777一区二区| 亚洲摸下面视频| av成人免费在线观看| 亚洲大胆视频| 欧美成人黑人xx视频免费观看| 小黄鸭精品aⅴ导航网站入口| 在线视频精品一区| 亚洲精品视频在线观看免费| 伊人成年综合电影网| 国产最新精品精品你懂的| 国产精品久久久久婷婷| 欧美日韩第一页| 欧美激情亚洲一区| 免费观看欧美在线视频的网站| 久久精品国产综合精品| 午夜精品久久久久久久99水蜜桃 | 欧美一区91| 午夜亚洲性色视频| 午夜国产精品视频| 亚洲欧美综合另类中字| 亚洲欧美日韩一区二区三区在线| 一区二区三区波多野结衣在线观看| 亚洲精选一区| 日韩一级大片在线| 一区二区三区毛片| 亚洲少妇最新在线视频| 正在播放日韩| 午夜久久久久久| 欧美一区中文字幕| 国产一区视频观看| 亚洲国产精品va| 欧美激情精品久久久久久蜜臀| 欧美成人一区在线| 亚洲日本中文字幕| 亚洲另类视频| 亚洲一区二区三区久久| 午夜精品理论片| 久久福利精品| 欧美刺激性大交免费视频| 欧美精品免费视频| 国产精品美女久久久久av超清 | 一区二区三区鲁丝不卡| 亚洲一区二区三区四区五区黄 | 国产精品99久久久久久宅男 | 香蕉成人啪国产精品视频综合网| 久久av红桃一区二区小说| 玖玖视频精品| 欧美日韩在线一区二区| 国产欧美日韩一区二区三区在线观看 | 在线欧美影院| 一本一道久久综合狠狠老精东影业 | 国产一区自拍视频| 亚洲精品乱码久久久久久蜜桃91 | 国产精品视频免费观看| 国内精品免费午夜毛片| 亚洲国产欧美一区二区三区丁香婷| 日韩一区二区福利| 欧美在线视频在线播放完整版免费观看 | 伊甸园精品99久久久久久| 亚洲免费观看视频| 久久久777| 亚洲三级观看| 欧美中在线观看| 欧美日韩精品在线播放| 国产日本欧美在线观看| 亚洲精品一级| 欧美资源在线| 一本色道久久综合狠狠躁篇怎么玩 | 亚洲二区精品| 欧美一乱一性一交一视频| 欧美韩日一区二区| 午夜一区不卡| 欧美三级午夜理伦三级中视频| 国内外成人免费激情在线视频| 中文国产亚洲喷潮| 亚洲电影免费在线观看| 欧美一级视频免费在线观看| 欧美伦理视频网站| 精品电影在线观看| 久久国产精品第一页| 99精品福利视频| 欧美激情无毛| 在线精品福利| 久久久噜噜噜久噜久久| 亚洲桃色在线一区| 欧美夫妇交换俱乐部在线观看| 国产午夜久久久久| 亚洲欧美日韩精品久久| 亚洲精品中文字幕有码专区| 久久综合五月| 在线观看亚洲精品视频| 久久久精品久久久久| 亚洲一区二区三区四区中文| 欧美日韩国产色视频| 亚洲精品一二区| 亚洲高清视频在线| 模特精品在线| 亚洲国产另类精品专区| 美日韩丰满少妇在线观看| 欧美在线短视频| 国产无一区二区| 性久久久久久久久久久久| 夜夜嗨一区二区三区| 欧美色大人视频| 亚洲无线视频| aa成人免费视频| 国产精品高潮呻吟久久av黑人| 夜夜嗨网站十八久久| 亚洲精品乱码久久久久久按摩观| 欧美福利精品| 一本色道久久综合精品竹菊|