|
本帖最后由 luoxb 于 2024-3-24 11:24 编辑
第一次写系统
想要做一个从船体生成电弧的技能,可是没有任何效果
system文件:
- {
- "id":"antiGField",
- "type":"STAT_MOD",
- "aiType":"PHASE_DISPLACER",
-
- "statsScript":"data.shipsystems.scripts.antiGField",
-
- "useSound":"system_phase_skimmer",
- "outOfUsesSound":"gun_out_of_ammo",
-
- "aiHints":{
-
- }
- }
复制代码
脚本:
- package data.shipsystems.scripts;
- //import java.util.List;
- import org.lwjgl.util.vector.Vector2f;
- import com.fs.starfarer.api.combat.EmpArcEntityAPI;
- //import com.fs.starfarer.api.combat.MissileAPI;
- import com.fs.starfarer.api.combat.CombatEngineAPI;
- import com.fs.starfarer.api.Global;
- import com.fs.starfarer.api.combat.DamageType;
- import com.fs.starfarer.api.combat.MutableShipStatsAPI;
- import com.fs.starfarer.api.combat.ShipAPI;
- import com.fs.starfarer.api.impl.combat.BaseShipSystemScript;
- //import com.fs.starfarer.api.plugins.ShipSystemStatsScript.State;
- public class antiGField extends BaseShipSystemScript{
- public void apply(MutableShipStatsAPI stats, String id,float effectLevel) {
- //get ship
- ShipAPI source = null;
- if (stats.getEntity() instanceof ShipAPI) {
- source = (ShipAPI)stats.getEntity();}
- else {return;}
-
- float DAMAGE = 20000;
- float EMP = 600;
- float RANGE = 6000;
- float THICKNESS = 5;
-
- CombatEngineAPI engine= Global.getCombatEngine();
-
- Vector2f pos = source.getLocation();
-
- ShipAPI target = engine.getShips().get(0);
-
- EmpArcEntityAPI arc = engine.spawnEmpArc(source, pos, source, target, DamageType.ENERGY,
- DAMAGE*effectLevel, EMP*effectLevel, RANGE*effectLevel, null, THICKNESS*effectLevel, null, null);
-
- }
- }
复制代码
总之到了测试战役里面唯一的效果就是播放了音效
|
|