public override void OnEvent(TakeBodyApprove evnt) { LocalPlayer.AnimControl.setMutantPickUp(evnt.Body.gameObject); SetCorpsePosition setCorpsePosition = SetCorpsePosition.Create(GlobalTargets.OnlyServer); setCorpsePosition.Corpse = evnt.Body; setCorpsePosition.Corpse.Freeze(false); setCorpsePosition.Pickup = true; setCorpsePosition.Send(); }
public void TakeBodyMP(BoltEntity body, BoltConnection from) { if (!body) { return; } dummyTypeSetup componentInChildren = body.gameObject.GetComponentInChildren <dummyTypeSetup>(); MultiHolder multiHolder; if (base.state.IsReal) { IMultiHolderState state = base.state; multiHolder = this; } else { if (!base.state.Replaces) { return; } IMultiHolderState state = base.state.Replaces.GetState <IMultiHolderState>(); multiHolder = base.state.Replaces.GetComponentsInChildren <MultiHolder>(true)[0]; } bool flag = false; TakeBodyApprove takeBodyApprove = (from != null) ? TakeBodyApprove.Create(from) : TakeBodyApprove.Create(GlobalTargets.OnlySelf); if (base.state.Body0 == body) { Debug.Log("TakeBody:Body0:" + base.state.Body0); flag = true; takeBodyApprove.Body = body; takeBodyApprove.Send(); base.state.Body0 = null; multiHolder._contentActual = 0; multiHolder._contentTypeActual = MultiHolder.ContentTypes.None; multiHolder._bodyTypes[0] = EnemyType.regularMale; } else if (base.state.Body1 == body) { Debug.Log("TakeBody:Body1:" + base.state.Body1); flag = true; takeBodyApprove.Body = body; takeBodyApprove.Send(); base.state.Body1 = null; multiHolder._contentActual = 1; multiHolder._bodyTypes[1] = EnemyType.regularMale; } else if (base.state.Body2 == body) { Debug.Log("TakeBody:Body2:" + base.state.Body2); flag = true; takeBodyApprove.Body = body; takeBodyApprove.Send(); base.state.Body2 = null; multiHolder._contentActual = 2; multiHolder._bodyTypes[2] = EnemyType.regularMale; } if (flag) { body.GetState <IMutantState>().Transform.SetTransforms(body.transform); } }