Hey everyone, I was trying to put some restrictions on Anachrons Inventory system. Like I put a boolean where it doesn't do anything if the aquiring unit is a building (since I have buildings that do that in my map). But now I want to make a condition where nothing happens if the item is a power. The thing is I can't figure out how to reference the item as it's picked up.
note the ??? marks...
Thanks guys, you've all helped me so much!
note the ??? marks...
JASS:
ibrary CIEvents
endlibrary
module CIEvents
public method pick takes CustomItem ci returns boolean
if .checkPickup(ci) and IsUnitType(.carrier,UNIT_TYPE_STRUCTURE)== false and IsItemPowerup(???)== false then
call ci.pick(.carrier)
call .addItem(ci)
return true
endif
return false
endmethod
public method drop takes CustomItem ci returns boolean
if .hasItem(ci) then
call ci.drop(.carrier)
return .remItem(ci)
endif
return false
endmethod
public method pawn takes CustomItem ci returns boolean
if .hasItem(ci) then
call ci.pawn(.carrier)
return true
endif
return false
endmethod
public method use takes CustomItem ci returns boolean
if .hasItem(ci) then
call ci.use(.carrier)
return true
endif
return false
endmethod
endmodule
Thanks guys, you've all helped me so much!