public FieldObject(FieldObjectEntity objectField, WorldAnchor anchor) : base(objectField.collisionWidth, objectField.collisionHeight, anchor) { this.objectField = objectField; this.overlapEvent = objectField.overlapEventType; vectorControl = new VectorControl(this); }
public Projectile(GameInstance parent, float initX, float initY, FieldObjectEntity objectField, ProjectileEntity objectProjectile) : base(parent.Rect.point.layer, initX, objectField, parent.ToLeft) { Move(new Vector2(0, initY)); this.objectProjectile = objectProjectile; this.parent = parent; }
public StageObject(FieldObjectEntity fieldObjectEntity, StageObjectEntity2 stageObjectEntity, FSM parentFsm) : base(fieldObjectEntity, true, parentFsm) { Assert.IsTrue(stageObjectEntity != null); this.stageObjectEntity = stageObjectEntity; this.stat = new Stat2<StageObjectStatType>(StatGenerator.ExportData<StageObjectStatType>(stageObjectEntity)); this.status = new Status2<StageObjectStatusType>(stat, new Status2<StageObjectStatusType>.Init(StageObjectStatusType.hp, 0, StageObjectStatType.maxHP, StageObjectStatType.maxHP)); Register(stat); Register(status); }
public static EffectiveFloorEntity create( Vector3?position = null, /* * float pos_x = 0, * float pos_z = 0, */ Vector3?rotation = null, int effective_size = 0, FieldObjectEntity entity = null) { return(new EffectiveFloorEntity { position = position ?? new Vector3(float.MinValue, float.MinValue, float.MinValue), /* * pos_x = pos_x, * pos_z = pos_z, */ effective_size = effective_size, rotation = rotation ?? Vector3.zero, entity = entity, }); }
public HeroCharacter(FieldObjectEntity objectField, SubClassEntity subClassEntity, ClassLevelEntity levelEntity, TrainLevelEntity trainLevelEntity, bool toLeft, InGameUser user, PuzzlePanel puzzlePanel, Buff.Handle onBuff, Buff.Handle onDeBuff, FSM parentFsm) : base(objectField, toLeft, parentFsm) { this.subClassEntity = subClassEntity; this.user = user; this.puzzlePanel = puzzlePanel; this.stat = new Stat2<HeroStatType>(StatGenerator.ExportData<HeroStatType>(levelEntity, trainLevelEntity)); this.status = InitStatus(this, stat, subClassEntity); Register(stat); Register(status); /* RegisterDeathCondition(x => x.Get(HeroStatusType.hp) == 0); RegisterBuffHandler(onBuff, onDeBuff); RegistActions(); SkillCommand skillCommand = InitSkill(this, skillId, itemHeroLevel.Level); AddCommandSet("skill", 1, false, E_CommandConsume.Skill, null).TryAdd(skillCommand); * */ }
protected Automaton(FieldObjectEntity objectField, bool toLeft, FSM parentFsm) : base(objectField, toLeft, null, null) { this.parentFsm = parentFsm; this.commandQueue = new Dictionary<string, CommandSet>(); }
static HeroCharacter CreateCharacter(FieldObjectEntity objectField, ClassLevelEntity levelEntity, TrainLevelEntity trainLevelEntity, SubClassEntity subClassEntity, InGameUser user, PuzzlePanel puzzlePanel, ConsumableSpawn itemDropManager, System.Action<StatusEffectEntity2> addBuffIcon, System.Action<StatusEffectEntity2> removeBuffIcon, FSM parentFsm) { Buff.Handle onBuff = delegate(Buff buff) { if (addBuffIcon != null) { addBuffIcon(buff.statusEffectEntity); } }; Buff.Handle onDeBuff = delegate(Buff buff) { if (removeBuffIcon != null) { removeBuffIcon(buff.statusEffectEntity); } }; HeroCharacter heroCharacter = new HeroCharacter(objectField, subClassEntity, levelEntity, trainLevelEntity, false, user, puzzlePanel, onBuff, onDeBuff, parentFsm); { Action action = ActionPattern.Create("Vector(Self; [HeroStatType.moveSpeed]; 0; 0; false)").Generate(heroCharacter.Stat); heroCharacter.Fire(action, null); heroCharacter.PauseMoving(); } for (int i = 0; i < 4; i++) { heroCharacter.AddItemSlot(i, user.commandQueue); } { heroCharacter.AddAction(Action.E_Type.Money, delegate(float value, GameInstance firer, string[] param) { Action action = ActionPattern.Create("Action(User; Money; {0})").Generate(heroCharacter.Stat, value); if (action != null) { heroCharacter.Fire(action, null); } return null; } ); heroCharacter.AddAction(Action.E_Type.Exp, delegate(float value, GameInstance firer, string[] param) { Action action = ActionPattern.Create("Action(User; Exp; {0})").Generate(heroCharacter.Stat, value); if (action != null) { heroCharacter.Fire(action, null); } return null; } ); heroCharacter.AddAction(Action.E_Type.GetConsumable, delegate(float value, GameInstance firer, string[] param) { if (RandomTool.IsIn(value)) { var itemCommand = new ItemCommand(itemDropManager.Pick()); if (itemCommand != null) { heroCharacter.TryAddItem(itemCommand); } } return null; } ); } return heroCharacter; }
public GameInstance(FieldObjectEntity objectField, bool toLeft, Action<StatusEffectEntity2> onAttach, Action<StatusEffectEntity2> onDetach) : base(objectField, toLeft ? WorldAnchor.BottomLeft : WorldAnchor.BottomRight) { statusEffectControl = new StatusEffectControl(this, onAttach, onDetach); }
public Monster(FieldObjectEntity fieldObjectEntity, StageObjectEntity2 stageObjectEntity, FSM parentFsm) : base(fieldObjectEntity, stageObjectEntity, parentFsm) { this.stat = new Stat<MonsterStatType>(StatGenerator.ExportData<MonsterStatType>(stageObjectEntity)); Debug.Log(stat); }
public ActionCollider(Layer layer, float initX, FieldObjectEntity objectField, bool toLeft) : base(objectField, toLeft, null, null) { }
public ProjectileCustom(GameInstance parent, float initX, float initY, FieldObjectEntity objectField, ProjectileEntity objectProjectile, Action2 action) : base(parent, initX, initY, objectField, objectProjectile) { List<VectorEntity> pattern = VectorGenerator.Custom(objectProjectile.speed, objectProjectile.speedY, objectProjectile.gravity, parent.ToLeft); //pattern.Add(new LinearVelocity(parent.Velocity)); SetMove(pattern); InitAction(action); }