Core.Object | +--Engine.Actor | +--Engine.Pawn | +--XIIIMP.TheDuck | +--XIIIMP.TheCatchableDuck
00001 //----------------------------------------------------------- 00002 // 00003 //----------------------------------------------------------- 00004 class TheCatchableDuck extends TheDuck; 00005 00006 00007 //_____________________________________________________________________________ 00008 00009 event Bump( Actor Other ) 00010 { 00011 if( Pawn(Other) != none ) 00012 { 00013 GiveSomething( class'SuperDuck',XIIIPawn(Other)); 00014 XIIIMPDuckController(Controller).gotostate('Catched'); 00015 00016 if( CatchableDuckBotController( Pawn(Other).controller ) != none ) 00017 CatchableDuckBotController( Pawn(Other).controller ).GetTheDuck(); 00018 } 00019 00020 } 00021 00022 //_____________________________________________________________________________ 00023 00024 function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation,vector momentum, class<DamageType> damageType) 00025 { 00026 XIIIMPDuckController(controller).Damaged(instigatedBy); 00027 Spawn(class'BlastDuck',,, Location); 00028 00029 return; 00030 } 00031 00032 //_____________________________________________________________________________ 00033 00034 function Inventory GiveSomething(class<Inventory> ItemClass, XIIIPawn P) 00035 { 00036 local Inventory NewItem; 00037 00038 if( P.FindInventoryType(ItemClass)==None ) 00039 { 00040 NewItem = Spawn(ItemClass,,,P.Location); 00041 00042 if( NewItem != None ) 00043 NewItem.GiveTo(P); 00044 } 00045 else 00046 { 00047 NewItem = P.FindInventoryType(ItemClass); 00048 00049 if ( Ammunition(NewItem) != none ) 00050 Ammunition(NewItem).AmmoAmount += Class<Ammunition>(ItemClass).default.AmmoAmount; 00051 } 00052 00053 return NewItem; 00054 } 00055 00056 //_____________________________________________________________________________ 00057 00058 00059 00060 defaultproperties 00061 { 00062 }