Here is a fishing code I just made I haven't tested it JUST yet so test it out and change stuff around as much as you want also I was thinking about making more fishing rods for better probability of catching a fish! and maybe adding bait. But i'll shutup and here is the code ith full! comments!:
obj Water icon = 'Turfs.dmi' //change if you want to. icon_state = "Water" //change if you want to.These were the models for water density = 1 // so you cant walk in it DUH! verb Fish() // fish verb allowing you wo figh :D set src in oview(1) // only fish if water is next to you var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents // you have to have a fishing rod to fish! if(Fishing_rod) // if you have a fishing rod. usr"You start fishing." // says in say mode sleep(30) // pauses for 3 seconds if (prob(20)) // 20% of catching a fish (change if you want) usr"You catch a fish!" // if you catch a fish this message is displayed usr.contents+=new/obj/Fish // you get a fish! else usr"You don't catch anything." // if you don't catch a fish else usr"You need a Fishing rod." //if you don't have a rod
obj Fishing_rod // the fishing rod! icon = 'Etc.dmi' // change if you want icon_state = "3" // change if you want verb Get() // pickup if next to you set src in oview(1) //next to you usr.contents+=new/obj/Fishing_rod // get a fishing rod! del src // del it! Drop() // drop it! src.Move(usr.loc) // moved to the ground where you are at.
Fish // the feesh! icon = 'Etc.dmi' // change if you want icon_state = "fish" // change if you want verb Get() // if someone dropped a fish...STEAL IT! set src in oview(1)// only if close to you usr.contents+=new/obj/Fish // get the fish del src // and del it! Drop() // drop it! src.Move(usr.loc) // move to your location! Eat() // EAT! usr"You eat the [src]." // you eat the fish! usr.HP+=200 // heal me! del src // and del me!
//Created by Bakasensei you can change anything you want and please don't just copy and paste learn off of it!
You don't have to give me credit but you can. You also can change ANYTHING you want also adding bait and more fishing rods for better probability of catching a fish.
That is the base code if you want to add another fishing rod.
obj Fishing_rod2 // the better fishing rod! icon = 'Etc.dmi' // change if you want icon_state = "3" // change if you want verb Get() // pickup if next to you set src in oview(1) //next to you usr.contents+=new/obj/Fishing_rod2 // get a fishing rod! del src // del it! Drop() // drop it! src.Move(usr.loc) // moved to the ground where you are at.
obj Water icon = 'Turfs.dmi' //change if you want to. icon_state = "Water" //change if you want to.These were the models for water density = 1 // so you cant walk in it DUH! verb Fish() // fish verb allowing you wo figh :D set src in oview(1) // only fish if water is next to you var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents // you have to have a fishing rod to fish! if(Fishing_rod) // if you have a fishing rod. usr"You start fishing." // says in say mode sleep(30) // pauses for 3 seconds if (prob(20)) // 20% of catching a fish (change if you want) usr"You catch a fish!" // if you catch a fish this message is displayed usr.contents+=new/obj/Fish // you get a fish! else usr"You don't catch anything." // if you don't catch a fish else usr"You need a Fishing rod." //if you don't have a rod var/obj/Fishing_rod2 = locate(/obj/Fishing_rod2) in usr.contents // you have to have a fishing rod to fish! if(Fishing_rod2) // if you have a fishing rod. usr"You start fishing." // says in say mode sleep(30) // pauses for 3 seconds if (prob(50)) // 50% of catching a fish (change if you want) usr"You catch a fish!" // if you catch a fish this message is displayed usr.contents+=new/obj/Fish // you get a fish! else usr"You don't catch anything." // if you don't catch a fish else usr"You need a Fishing rod." //if you don't have a rod
obj Water icon = 'Turfs.dmi' //change if you want to. icon_state = "Water" //change if you want to.These were the models for water density = 1 // so you cant walk in it DUH! verb Fish() // fish verb allowing you wo figh :D set src in oview(1) // only fish if water is next to you var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents // you have to have a fishing rod to fish! var/obj/bait = locate(/obj/bait) in usr.contents if(usr.bait>=1) usr " You use up bait!" else usr " You need more bait." return usr.contents -= 1 /obj/bait if(Fishing_rod) // if you have a fishing rod. usr"You start fishing." // says in say mode sleep(30) // pauses for 3 seconds if (prob(20)) // 20% of catching a fish (change if you want) usr"You catch a fish!" // if you catch a fish this message is displayed usr.contents+=new/obj/Fish // you get a fish! else usr"You don't catch anything." // if you don't catch a fish else usr"You need a Fishing rod." //if you don't have a rod
obj bait // the bait icon = 'Turfs.dmi' //change if you want icon_state = "4" //change if you want verb Get() // pickup if next to you set src in oview(1) //next to you usr.contents += 5 new/obj/bait // get a fishing rod! del src // del it! Drop() // drop it! src.Move(usr.loc) // moved to the ground where you are at.
And that is if you want bait. And that is all I can think of for fishing I hope I have helped and if any of these don't work please tell me Stego.