Re: [问题] 所谓的魔法究竟是指什么

楼主: sunup5566 (日上56)   2016-10-23 23:58:02
魔法是驱动时间的力量
也是物质 能量 时空的根本
我们所处的宇宙
所在的星系
所站的大地
全部源自由魔法构成的系统
其实用这个系统的SDK和system call
来操控世间万物的developer
就是大家说的魔法使
像是大家都很喜欢的爆裂魔法
大概就是一段长这样的code:
using Universe;
using Universe.Antimatter;
using Universe.Constant;
using Universe.Matter;
using Universe.TimeSpace;
using Magic.FireMagic;
using Magic.Magica.Human;
using Magic.Mana;
namespace FireMagic
{
public class Explosion : FireMagicBase
{
/// <summary>
/// 人类用的爆裂魔法:
/// 召唤反氢气并导入特定的时空引起爆炸
/// </summary>
Antimatter h_antimatter;
Volume antimatterVol;
TimeSpace targetTs;
public Explosion(TimeSpace ts, double radius) :
base(FireMagicLevel.Advanced, FireMagicType.Circle, radius)
{
targetTs = ts;
h_antimatter = Antimatter.AntimatterFactory(Matter.H, MatterPhase.STPGas, MatterCharge.Balanced);
h_antimatter.SetMassByEnergy(base.MaxEnergy);
h_antimatter.SetBackGroundTimeSpace(ts);
antimatterVol = Antimatter.CountVolume(h_antimatter);
ManaCost = base.ManaCost;
ManaCost += h_antimatter.ManaCost;
ManaCost += targetTs.ManaCostToCreateCopy(antimatterVol);
ManaCost += targetTs.ManaCostToFreeze(antimatterVol);
ManaCost += targetTs.ManaCostToSwap(antimatterVol);
ManaCost += targetTs.ManaCostToResume(antimatterVol);
CoolDown = base.CoolDown;
CoolDown += h_antimatter.CoolDown;
CoolDown += targetTs.CreateCopyCoolDown(antimatterVol);
CoolDown += targetTs.FreezeCoolDown(antimatterVol);
CoolDown += targetTs.SwapCoolDown(antimatterVol);
CoolDown += targetTs.ResumeCoolDown(antimatterVol);
}
public double ManaCost
{
get;
protected set;
}
public double CoolDown
{
get;
protected set;
}
public override void Cast(Human caster, Vector4F target)
{
UniversalMana mana = UniversalMana.UniversalManaFactory(caster, ManaCost);
if(mana == null)
throw new NotEnoughManaException();
TimeSpace castAt = targetTs.GetSubTimeSpace(target, antimatterVol);
TimeSpace _castAt = TimeSpace.TimeSpaceFactory(mana, castAt);
try {
h_antimatter.CreateAntimatter(mana, _castAt);
castAt.Freeze(mana);
targetTs.Swap(mana, castAt, _castAt);
castAt.Resume(mana);
}
catch(CoolingDownException e) {
throw e;
}
catch(Exception e) {
if(Human.CanHandle(e)) {
throw e;
}
}
finally {
caster.SendMessage("EXPLOSION!!!!!");
}
}
}
}
魔法师使用这个魔法时
要先建立一个爆裂魔法的执行个体
Explosion h_ex = new Explosion(TimeSpace.LocalTimeSpace, 100);
接着呼叫其中的施放方法
h_ex.Cast(this, Samsung.LocationOnEarth.ToUniversalCoord());
就能快乐的使用爆裂魔法啦~
话说如果有Exception也没关系
反正Exception跟Explosion也差不了多少
作者: hermis (火山菌病病人No.01221)   2015-10-23 23:58:00
不要这样wwww
作者: Doracacazin (哆啦)   2016-10-23 23:59:00
哭了
作者: SuperSg (萌翻天的时代来啦°▽°)   2016-10-23 23:59:00
快推,不然别人会以为我看的懂
作者: greenslime (路边野草不要踩)   2016-10-24 00:00:00
除了最后一行都看不懂wwwwww
作者: norta (moonhorn)   2016-10-24 00:01:00
偷婊三星 很好
作者: tw15 (巴拉巴拉)   2016-10-24 00:01:00
不要在.Cast里面放进Samsung啦XD
作者: ts1993 (komi1111)   2016-10-24 00:03:00
偷裱三星
作者: GeogeBye (bye)   2016-10-24 00:17:00
写这么长一篇 给个推 虽然我看不懂
作者: alanqq0624 (fallere725)   2016-10-24 00:24:00
总而言之先推
作者: suhorng ( )   2016-10-24 06:02:00

Links booklink

Contact Us: admin [ a t ] ucptt.com