Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace XRL.World.Parts
- {
- [Serializable]
- public class AmmoSlug : IPart
- {
- public string ProjectileObject;
- public AmmoSlug()
- {
- // Name = "AmmoSlug";
- }
- public override bool SameAs(IPart p)
- {
- return true;
- }
- public override bool AllowStaticRegistration()
- {
- return true;
- }
- public override void Register(GameObject Object)
- {
- Object.RegisterPartEvent(this, "QueryEquippableList");
- Object.RegisterPartEvent(this, "GetProjectileObject");
- }
- public override bool FireEvent(Event E)
- {
- if (E.ID == "GetProjectileObject")
- {
- E.AddParameter("Projectile", GameObjectFactory.Factory.CreateObject(ProjectileObject));
- return true;
- }
- if (E.ID == "QueryEquippableList")
- {
- if ((E.GetParameter("EquippableList") as List<GameObject>).CleanContains(ParentObject)) return true;
- if ((E.GetParameter("SlotType") as string).Contains("AmmoSlug"))
- {
- (E.GetParameter("EquippableList") as List<GameObject>).Add(ParentObject);
- return true;
- }
- else
- {
- return true;
- }
- }
- return true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement