- UID
- 44787
- UCC
-
- 声望
-
- 好评
-
- 贡献
-
- 最后登录
- 1970-1-1
|
现阶段我已经制作好大部分我要添加进MOD第一个版本的子系统图标,包括各种安全反应堆、重力引擎、亚原子粒子体装甲及隔仓,安全反物质反应堆和中子炮暂时用GA的,哪个护盾太难做了。
现阶段我已经初步完成无工质引擎的代码(可运作,未测试BUG),并尝试制作无视穿甲效果的装甲相关代码,若成功还会挑战让穿甲效果减半的装甲。
我第一个添加进MOD的的子系统是重力发动机,只耗电不消耗燃料。截图:
子系统描述
关于只靠该引擎加速的证明:
相关代码(BasicEffects.as):void SpeedIfPower(Event@ evt, float Amount, float PowCost) {
State@ power = evt.obj.getState(strPower);
// Check if we have enough power
if (power.getAvailable() <= evt.time * PowCost) {
evt.state = ESC_DISABLE;
return;
}
// Add thrust
HulledObj@ obj = evt.obj;
if (obj !is null) {
obj.thrust = obj.thrust + Amount;
}
}
void PowerThrustCons(Event@ evt, float PowCost) {
Object@ obj = evt.obj;
if(obj.velocity.getLengthSQ() > 0.f && obj.inOrbitAround() is null) {
State@ pow = obj.getState(strPower);
PowCost *= evt.time;
if(pow.getAvailable() >= PowCost) {
pow.consume(PowCost,obj);
}
else {
evt.state = ESC_DISABLE;
}
}
}
Effects.txt:
//New
Name: PowerThrust
Value: Amount
Value: PowCost
OnActive: BasicEffects::SpeedIfPower
OnDeactive: DecSpeed(Amount)
Tick: BasicEffects::PowerThrustCons
System: GravityThruster
Name: #SS_GRAVITYTHRUSTER_NAME
Description: #SS_GRAVITYTHRUSTER_DESC
Appearance: ThrusterGravity
Explosion: armor_explode lasting 0.4
Tags: Engine
Tied To: Engines 5, EnergyPhysics 5
Available: (Techs.Engines.Level > 4) && (Techs.EnergyPhysics.Level > 4)
Level: floor(weight(Techs.Engines.Level, 0.7, Techs.EnergyPhysics.Level, 0.3))
Size: Scale
HPLevel: Techs.Materials.Level-1 As Level
Durability: HEALTH_MULT * 50 * Size * pow(HEALTH_CURVE,HPLevel)
Mass: 50 * Size
Costs: Metals[200 * progress(Size, 0.05, Level)], Electronics[15 * progress(Size, 0.05, Level)], AdvParts[100 * progress(Size, 0.05, Level)], Labr[5 * Size]
Complexity: 0.5
vThrust: Size * 700 * (2 - decay(pow(LEVEL_GAIN_CURVE,Level),35)) * GAME_THRUST_MULT
vPowCost: 15 * decay(pow(LEVEL_GAIN_CURVE,Level),35) * Size //was 5 * decay...
Provides: FuelStorage with
Amount[Size * 10]
Provides: PowerThrust with
Amount[vThrust],
PowCost[vPowCost]
Requires:
To Run: Control[15 * Size] //Was[5 * Size]
Hints: Thrust[vThrust], Power[vPowCost * -1], Fuel[Size * 10]
(科技需求还没改)
新完成的图标
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|